From c14b117121d2d401bcc415d00fe046a3e123d2e4 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 29 Jan 2024 17:58:53 +0100 Subject: [PATCH] [fix] brave.search - update result selectors to fit to new layout Closes: https://github.com/searxng/searxng/issues/3167 Signed-off-by: Markus Heiser --- searx/engines/brave.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searx/engines/brave.py b/searx/engines/brave.py index dcc5ca279..6b65ae667 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -260,7 +260,9 @@ def _parse_search(resp): for result in eval_xpath_list(dom, xpath_results): url = eval_xpath_getindex(result, './/a[contains(@class, "h")]/@href', 0, default=None) - title_tag = eval_xpath_getindex(result, './/div[contains(@class, "url")]', 0, default=None) + title_tag = eval_xpath_getindex( + result, './/a[contains(@class, "h")]//div[contains(@class, "title")]', 0, default=None + ) if url is None or title_tag is None or not urlparse(url).netloc: # partial url likely means it's an ad continue