summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
author0xhtml <34682885+0xhtml@users.noreply.github.com>2024-07-29 21:53:29 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-08-08 09:59:45 +0200
commit7f9ce3b96e2c51aa218c3a6f554e3d8e4b9096f9 (patch)
tree680c8aab7a4b2e964c75309517c393be32db739d /searx/engines/google.py
parente76a4f72ef956b7dff0550096392a4621c7a8038 (diff)
downloadsearxng-7f9ce3b96e2c51aa218c3a6f554e3d8e4b9096f9.tar.gz
searxng-7f9ce3b96e2c51aa218c3a6f554e3d8e4b9096f9.zip
[fix] engine google: strip bubble text from answers
Google underlines words inside of answers that can be clicked to show additional definitions. These definitions inside the answer were not correctly handled and ended up in the middle of the answer text. With this fix, the extra definitions are stripped from the answer shown by the frontend.
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 90d687a4e..3eaf1c19d 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -334,6 +334,8 @@ def response(resp):
# results --> answer
answer_list = eval_xpath(dom, '//div[contains(@class, "LGOjhe")]')
for item in answer_list:
+ for bubble in eval_xpath(item, './/div[@class="nnFGuf"]'):
+ bubble.drop_tree()
results.append(
{
'answer': item.xpath("normalize-space()"),