mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
Merge branch 'master' into gigablast
This commit is contained in:
commit
8d318ee142
20 changed files with 576 additions and 126 deletions
|
@ -50,6 +50,7 @@ result_xpath = '//div[@class="result results_links results_links_deep web-result
|
|||
url_xpath = './/a[@class="result__a"]/@href'
|
||||
title_xpath = './/a[@class="result__a"]'
|
||||
content_xpath = './/a[@class="result__snippet"]'
|
||||
correction_xpath = '//div[@id="did_you_mean"]//a'
|
||||
|
||||
|
||||
# match query's language to a region code that duckduckgo will accept
|
||||
|
@ -125,6 +126,11 @@ def response(resp):
|
|||
'content': content,
|
||||
'url': res_url})
|
||||
|
||||
# parse correction
|
||||
for correction in eval_xpath(doc, correction_xpath):
|
||||
# append correction
|
||||
results.append({'correction': extract_text(correction)})
|
||||
|
||||
# return results
|
||||
return results
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ def response(resp):
|
|||
|
||||
for result in search_results[0].get('items', []):
|
||||
# parse image results
|
||||
if result.get('image'):
|
||||
if result.get('image') and result.get('width') and result.get('height'):
|
||||
|
||||
result_url = ''
|
||||
if 'url' in result:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue