mirror of https://github.com/searxng/searxng.git
Merge pull request #1556 from tiekoetter/fix-google-results-xpath
[fix] google engine: results XPath
This commit is contained in:
commit
50ec821e8c
|
@ -112,7 +112,7 @@ filter_mapping = {0: 'off', 1: 'medium', 2: 'high'}
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
# google results are grouped into <div class="jtfYYd ..." ../>
|
# google results are grouped into <div class="jtfYYd ..." ../>
|
||||||
results_xpath = '//div[@class="jtfYYd"]'
|
results_xpath = '//div[contains(@class, "jtfYYd")]'
|
||||||
|
|
||||||
# google *sections* are no usual *results*, we ignore them
|
# google *sections* are no usual *results*, we ignore them
|
||||||
g_section_with_header = './g-section-with-header'
|
g_section_with_header = './g-section-with-header'
|
||||||
|
@ -287,7 +287,6 @@ def request(query, params):
|
||||||
'oe': "utf8",
|
'oe': "utf8",
|
||||||
'start': offset,
|
'start': offset,
|
||||||
'filter': '0',
|
'filter': '0',
|
||||||
'ucbcb': 1,
|
|
||||||
**additional_parameters,
|
**additional_parameters,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -299,6 +298,7 @@ def request(query, params):
|
||||||
query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})
|
query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})
|
||||||
params['url'] = query_url
|
params['url'] = query_url
|
||||||
|
|
||||||
|
params['cookies']['CONSENT'] = "YES+"
|
||||||
params['headers'].update(lang_info['headers'])
|
params['headers'].update(lang_info['headers'])
|
||||||
if use_mobile_ui:
|
if use_mobile_ui:
|
||||||
params['headers']['Accept'] = '*/*'
|
params['headers']['Accept'] = '*/*'
|
||||||
|
|
Loading…
Reference in New Issue