From 64bc98b5fb74c553578445a9349fd3cd74234fa2 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 8 Aug 2023 18:18:28 +0200 Subject: [PATCH] [mod] brave: support for showing the answer source url --- searx/engines/brave.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/engines/brave.py b/searx/engines/brave.py index f45599212..d5e2d3e9f 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -237,7 +237,8 @@ def _parse_search(resp): answer_tag = eval_xpath_getindex(dom, '//div[@class="answer"]', 0, default=None) if answer_tag: - result_list.append({'answer': extract_text(answer_tag)}) + url = eval_xpath_getindex(dom, '//div[@id="featured_snippet"]/a[@class="result-header"]/@href', 0, default=None) + result_list.append({'answer': extract_text(answer_tag), 'url': url}) # xpath_results = '//div[contains(@class, "snippet fdb") and @data-type="web"]' xpath_results = '//div[contains(@class, "snippet")]'