diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2022-02-12 15:11:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-12 15:11:27 +0100 |
commit | 9cd9dfd26e07552419941a34369b084f2adc30f4 (patch) | |
tree | dcef13afb067fd80074cc1cf4b3fd3f27e237ffe | |
parent | 8aba8580579396378f3be12f69a8ab6e59e9255e (diff) | |
parent | 7d3e8118b0a0f09e2a2faf1135ed04300146e458 (diff) | |
download | searxng-9cd9dfd26e07552419941a34369b084f2adc30f4.tar.gz searxng-9cd9dfd26e07552419941a34369b084f2adc30f4.zip |
Merge pull request #887 from unixfox/patch-5
Update the XPath for fetching the Google results
-rw-r--r-- | searx/engines/google.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py index 13d270113..e5f24b166 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -111,9 +111,8 @@ filter_mapping = {0: 'off', 1: 'medium', 2: 'high'} # specific xpath variables # ------------------------ -# google results are grouped into <div class="g ..." ../> -results_xpath = '//div[@id="search"]//div[contains(@class, "g ")]' -results_xpath_mobile_ui = '//div[contains(@class, "g ")]' +# google results are grouped into <div class="jtfYYd ..." ../> +results_xpath = '//div[@class="jtfYYd"]' # google *sections* are no usual *results*, we ignore them g_section_with_header = './g-section-with-header' @@ -338,11 +337,7 @@ def response(resp): # parse results - _results_xpath = results_xpath - if use_mobile_ui: - _results_xpath = results_xpath_mobile_ui - - for result in eval_xpath_list(dom, _results_xpath): + for result in eval_xpath_list(dom, results_xpath): # google *sections* if extract_text(eval_xpath(result, g_section_with_header)): |