summaryrefslogtreecommitdiff
path: root/searx/engines/xpath.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2019-07-25 09:31:47 +0200
committerGitHub <noreply@github.com>2019-07-25 09:31:47 +0200
commitf34b5cedb11bcb38eb2ad76cc3ed2b5eb421a75a (patch)
tree2204c002afa5e787298e2f435143464ca929e1d0 /searx/engines/xpath.py
parentcac8e7c6b88c49f4e7446c286f552fbbf902d4b6 (diff)
downloadsearxng-f34b5cedb11bcb38eb2ad76cc3ed2b5eb421a75a.tar.gz
searxng-f34b5cedb11bcb38eb2ad76cc3ed2b5eb421a75a.zip
[fix] fixes google play engines (#1651)
update commit 87baa74a863ac74ae4c86bbfcb04148ba7f70696
Diffstat (limited to 'searx/engines/xpath.py')
-rw-r--r--searx/engines/xpath.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index a5f30d86d..61494ce4e 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -111,13 +111,10 @@ def response(resp):
tmp_result = {'url': url, 'title': title, 'content': content}
# add thumbnail if available
- thumbnail = None
if thumbnail_xpath:
- thumbnail = extract_url(
- result.xpath(thumbnail_xpath), search_url
- )
- if thumbnail:
- tmp_result['img_src'] = thumbnail
+ thumbnail_xpath_result = result.xpath(thumbnail_xpath)
+ if len(thumbnail_xpath_result) > 0:
+ tmp_result['img_src'] = extract_url(thumbnail_xpath_result, search_url)
results.append(tmp_result)
else: