summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-06-29 16:09:59 +0000
committerGitHub <noreply@github.com>2020-06-29 16:09:59 +0000
commit8d318ee1425b55d71b219d46d46860defa9e832b (patch)
tree1c6892a6ecbd9ded0ec7e16294ab7688ce80a69f /searx/engines
parent5fac6cffa2fc974e12fc4c07530561c380fbb1f0 (diff)
parent460401293ca8c57444f7a2e5709f2575b98ecfc2 (diff)
Merge branch 'master' into gigablast
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/duckduckgo.py6
-rw-r--r--searx/engines/yacy.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py
index 0d2c0af2d..6e07b5021 100644
--- a/searx/engines/duckduckgo.py
+++ b/searx/engines/duckduckgo.py
@@ -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
diff --git a/searx/engines/yacy.py b/searx/engines/yacy.py
index 25bc83687..f1d4c6abe 100644
--- a/searx/engines/yacy.py
+++ b/searx/engines/yacy.py
@@ -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: