From 23ac964e35a7d94ee4f0e739b52281944edf076b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 8 Apr 2023 09:43:04 +0200 Subject: [PATCH] [fix] Bing-WEB: use for the description On some result items from Bing-WEB the `` tag is the only tag that contains a description. The issue can be reproduced by [1]:: !bi vmware [1] https://github.com/searxng/searxng/issues/1764#issuecomment-1417990531 Reported-by: @AlyoshaVasilieva Signed-off-by: Markus Heiser --- searx/engines/bing.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/searx/engines/bing.py b/searx/engines/bing.py index 0f85c7036..81a0cf6a5 100644 --- a/searx/engines/bing.py +++ b/searx/engines/bing.py @@ -198,13 +198,11 @@ def response(resp): url = link.attrib.get('href') title = extract_text(link) - # Make sure that the element is free of links and content = eval_xpath(result, '(.//p)[1]') for p in content: + # Make sure that the element is free of links for e in p.xpath('.//a'): e.getparent().remove(e) - for e in p.xpath('.//span[@class="algoSlug_icon"]'): - e.getparent().remove(e) content = extract_text(content) # get the real URL either using the URL shown to user or following the Bing URL