[fix] Seznam engine - some XPath selectors has been changed

Merged from https://github.com/dudik/searx/commit/5a4207759

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Samuel Dudik 2021-07-26 19:57:55 +02:00 committed by Markus Heiser
parent 48fe83b901
commit 7a7ef9cea6
1 changed files with 2 additions and 2 deletions

View File

@ -53,14 +53,14 @@ def response(resp):
dom = html.fromstring(resp.content.decode()) dom = html.fromstring(resp.content.decode())
for result_element in eval_xpath_list(dom, '//div[@data-dot="results"]/div'): for result_element in eval_xpath_list(dom, '//div[@data-dot="results"]/div'):
result_data = eval_xpath_getindex(result_element, './/div[contains(@class, "Result")]', 0, default=None) result_data = eval_xpath_getindex(result_element, './/div[contains(@class, "bec586")]', 0, default=None)
if result_data is None: if result_data is None:
continue continue
title_element = eval_xpath_getindex(result_element, './/h3/a', 0) title_element = eval_xpath_getindex(result_element, './/h3/a', 0)
results.append({ results.append({
'url': title_element.get('href'), 'url': title_element.get('href'),
'title': extract_text(title_element), 'title': extract_text(title_element),
'content': extract_text(eval_xpath(result_data, './/p[@class="Result-description"]')), 'content': extract_text(eval_xpath(result_data, './/div[@class="_3eded7"]')),
}) })
return results return results