From b9f16a77dbb9ef2f78719055b33baafef539b6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milien=20Devos?= Date: Wed, 10 Aug 2022 09:36:06 +0000 Subject: [PATCH 1/2] output format protobuf to HTML for google mobile --- 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 5e80f6dcc..14bd26fc3 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -261,7 +261,7 @@ def request(query, params): if use_mobile_ui: additional_parameters = { 'asearch': 'arc', - 'async': 'use_ac:true,_fmt:pc', + 'async': 'use_ac:true,_fmt:html', } # https://www.google.de/search?q=corona&hl=de&lr=lang_de&start=0&tbs=qdr%3Ad&safe=medium From eb02cc77c56c8e93d305ee8aafc6e80c326e838f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 10 Aug 2022 18:55:31 +0200 Subject: [PATCH 2/2] [fix] google - simplify XPath selectors to fetch more results Signed-off-by: Markus Heiser --- searx/engines/google.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/searx/engines/google.py b/searx/engines/google.py index 14bd26fc3..9cb936ccf 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -112,21 +112,14 @@ filter_mapping = {0: 'off', 1: 'medium', 2: 'high'} # specific xpath variables # ------------------------ -# google results are grouped into
-results_xpath = '//div[contains(@class, "jtfYYd")]' +results_xpath = '//div[contains(@class, "MjjYud")]' +title_xpath = './/h3[1]' +href_xpath = './/a/@href' +content_xpath = './/div[@data-content-feature=1]' # google *sections* are no usual *results*, we ignore them g_section_with_header = './g-section-with-header' -# the title is a h3 tag relative to the result group -title_xpath = './/h3[1]' - -# in the result group there is