From 950f036c038db8a6af34d5e47f91f590ac517e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Tiek=C3=B6tter?= Date: Tue, 26 Jul 2022 00:24:15 +0200 Subject: [PATCH 1/2] [fix] google engine: results XPath --- searx/engines/google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/google.py b/searx/engines/google.py index 4468558ac..e54699081 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -112,7 +112,7 @@ filter_mapping = {0: 'off', 1: 'medium', 2: 'high'} # ------------------------ # google results are grouped into
-results_xpath = '//div[@class="jtfYYd"]' +results_xpath = '//div[contains(@class, "jtfYYd")]' # google *sections* are no usual *results*, we ignore them g_section_with_header = './g-section-with-header' From c72d70d45c5a9d7ed2e884db90ec6b84135f31a9 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 26 Jul 2022 06:39:44 +0200 Subject: [PATCH 2/2] Revert "Quick fix for google engine for EU countries" This reverts commit 747cf1a246df587aeb3b6b175c315ef0b9612dc4. --- searx/engines/google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/google.py b/searx/engines/google.py index e54699081..0d116db9f 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -287,7 +287,6 @@ def request(query, params): 'oe': "utf8", 'start': offset, 'filter': '0', - 'ucbcb': 1, **additional_parameters, } ) @@ -299,6 +298,7 @@ def request(query, params): query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]}) params['url'] = query_url + params['cookies']['CONSENT'] = "YES+" params['headers'].update(lang_info['headers']) if use_mobile_ui: params['headers']['Accept'] = '*/*'