summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-11-26 08:25:38 +0100
committerGitHub <noreply@github.com>2021-11-26 08:25:38 +0100
commit328473befd61c3df6e91772fc9dcce3bfb23830d (patch)
treec4590a6783dda203c368c4bd986cf8084ec8db12 /searx/engines/google.py
parentbd285de48a7db9f67c9e5dd50aba8742f552a245 (diff)
parent1ce09df9aa4d08d2125dca8f83906c5954048d0a (diff)
Merge pull request #547 from return42/fix-442
[fix] google & google video engines
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 4e6fa6190..578dec60c 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -138,12 +138,7 @@ content_xpath = './/div[@class="IsZvec"]'
# Suggestions are links placed in a *card-section*, we extract only the text
# from the links not the links itself.
-suggestion_xpath = '//div[contains(@class, "card-section")]//a'
-
-# Since google does *auto-correction* on the first query these are not really
-# *spelling suggestions*, we use them anyway.
-spelling_suggestion_xpath = '//div[@class="med"]/p/a'
-
+suggestion_xpath = '//div[contains(@class, "EIaa9b")]//a'
def get_lang_info(params, lang_list, custom_aliases, supported_any_language):
"""Composing various language properties for the google engines.
@@ -322,7 +317,6 @@ def response(resp):
# convert the text to dom
dom = html.fromstring(resp.text)
-
# results --> answer
answer_list = eval_xpath(dom, '//div[contains(@class, "LGOjhe")]')
if answer_list:
@@ -379,9 +373,6 @@ def response(resp):
# append suggestion
results.append({'suggestion': extract_text(suggestion)})
- for correction in eval_xpath_list(dom, spelling_suggestion_xpath):
- results.append({'correction': extract_text(correction)})
-
# return results
return results