mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
[fix] handle missing url scheme - fixes #428
This commit is contained in:
@@ -53,6 +53,8 @@ def response(resp):
|
|||||||
# parse results
|
# parse results
|
||||||
for result in dom.xpath(results_xpath):
|
for result in dom.xpath(results_xpath):
|
||||||
url = result.xpath(url_xpath)[0].text
|
url = result.xpath(url_xpath)[0].text
|
||||||
|
if not url.startswith('http://') and not url.startswith('https://'):
|
||||||
|
url = 'http://' + url
|
||||||
title = result.xpath(title_xpath)[0].text
|
title = result.xpath(title_xpath)[0].text
|
||||||
content = escape(result.xpath(content_xpath)[0].text)
|
content = escape(result.xpath(content_xpath)[0].text)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user