mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 12:51:02 +00:00
[fix] dbpedia autocomplete (and use HTTPS)
This commit is contained in:
parent
cec73b5dcf
commit
0226ae69d3
1 changed files with 2 additions and 3 deletions
|
@ -113,7 +113,7 @@ def searx_bang(full_query):
|
|||
|
||||
def dbpedia(query, lang):
|
||||
# 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)))
|
||||
|
||||
|
@ -121,8 +121,7 @@ def dbpedia(query, lang):
|
|||
|
||||
if response.ok:
|
||||
dom = etree.fromstring(response.content)
|
||||
results = dom.xpath('//a:Result/a:Label//text()',
|
||||
namespaces={'a': 'http://lookup.dbpedia.org/'})
|
||||
results = dom.xpath('//Result/Label//text()')
|
||||
|
||||
return results
|
||||
|
||||
|
|
Loading…
Reference in a new issue