1
0
mirror of https://github.com/searx/searx synced 2024-12-12 08:46:26 +01:00

[fix] dbpedia autocomplete (and use HTTPS)

This commit is contained in:
Alexandre Flament 2020-12-04 16:47:43 +01:00
parent cec73b5dcf
commit 0226ae69d3

View File

@ -113,7 +113,7 @@ def searx_bang(full_query):
def dbpedia(query, lang): def dbpedia(query, lang):
# dbpedia autocompleter, no HTTPS # dbpedia autocompleter, no HTTPS
autocomplete_url = 'http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?' autocomplete_url = 'https://lookup.dbpedia.org/api/search.asmx/KeywordSearch?'
response = get(autocomplete_url + urlencode(dict(QueryString=query))) response = get(autocomplete_url + urlencode(dict(QueryString=query)))
@ -121,8 +121,7 @@ def dbpedia(query, lang):
if response.ok: if response.ok:
dom = etree.fromstring(response.content) dom = etree.fromstring(response.content)
results = dom.xpath('//a:Result/a:Label//text()', results = dom.xpath('//Result/Label//text()')
namespaces={'a': 'http://lookup.dbpedia.org/'})
return results return results