From c6b1a0e6e73bd24be8e7b7903e901ca54135b815 Mon Sep 17 00:00:00 2001 From: jazzzooo <38244149+jazzzooo@users.noreply.github.com> Date: Thu, 21 Sep 2023 06:30:00 -0700 Subject: [PATCH] [fix] engine - brave don't show ads --- searx/engines/brave.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/brave.py b/searx/engines/brave.py index 13e262fa3..c713ffe50 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -246,7 +246,7 @@ def _parse_search(resp): url = eval_xpath_getindex(result, './/a[contains(@class, "h")]/@href', 0, default=None) title_tag = eval_xpath_getindex(result, './/div[contains(@class, "title")]', 0, default=None) - if url is None or title_tag is None: + if url is None or title_tag is None or not urlparse(url).netloc: # partial url likely means it's an ad continue content_tag = eval_xpath_getindex(result, './/div[@class="snippet-description"]', 0, default='')