summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorLéo Bourrel <leo.bourrel@epitech.eu>2018-07-05 10:11:45 +0200
committerLéo Bourrel <leo.bourrel@epitech.eu>2018-07-05 10:11:45 +0200
commitacaef6600e34159d2edb7bf0ef6b5f34471136e1 (patch)
treeb5c4ddb9ec576bd200043cf82b24e58f4c4c5737 /searx/engines
parent686a9428d4962f52ff51d0042a7dab1f754f6639 (diff)
downloadsearxng-acaef6600e34159d2edb7bf0ef6b5f34471136e1.tar.gz
searxng-acaef6600e34159d2edb7bf0ef6b5f34471136e1.zip
Update path to wikidata image
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/wikidata.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index fe53609c1..ffc1c8d0f 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -54,7 +54,7 @@ value_xpath = './/div[contains(@class,"wikibase-statementview-mainsnak")]'\
+ '/*/div[contains(@class,"wikibase-snakview-value")]'
language_fallback_xpath = '//sup[contains(@class,"wb-language-fallback-indicator")]'
calendar_name_xpath = './/sup[contains(@class,"wb-calendar-name")]'
-
+media_xpath = value_xpath + '//div[contains(@class,"commons-media-caption")]//a'
def request(query, params):
params['url'] = url_search.format(
@@ -313,7 +313,7 @@ def add_image(result):
for property_id in property_ids:
image = result.xpath(property_xpath.replace('{propertyid}', property_id))
if image:
- image_name = image[0].xpath(value_xpath)
+ image_name = image[0].xpath(media_xpath)
image_src = url_image.replace('{filename}', extract_text(image_name[0]))
return image_src