diff options
author | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-04-08 20:35:34 -0500 |
---|---|---|
committer | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-04-08 20:35:34 -0500 |
commit | 343e555ee96ab8b40b5ed4dce287331685eff3fa (patch) | |
tree | cc2c6ef569ddf3693f79a514c8851a44d6ff6a73 /searx/engines/xpath.py | |
parent | 283f6c905340087d7511bfcdb815c0b4183bcdda (diff) | |
download | searxng-343e555ee96ab8b40b5ed4dce287331685eff3fa.tar.gz searxng-343e555ee96ab8b40b5ed4dce287331685eff3fa.zip |
[fix] append http if no scheme is provided in xpath's extact_url
This solves a bug with Yahoo where some results don't specify
a protocol.
Diffstat (limited to 'searx/engines/xpath.py')
-rw-r--r-- | searx/engines/xpath.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index c8c56da44..50f98d935 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url): if url.startswith('//'): # add http or https to this kind of url //example.com/ parsed_search_url = urlparse(search_url) - url = u'{0}:{1}'.format(parsed_search_url.scheme, url) + url = u'{0}:{1}'.format(parsed_search_url.scheme or 'http', url) elif url.startswith('/'): # fix relative url to the search engine url = urljoin(search_url, url) |