Commit 1972a044 authored by Adam Tauber's avatar Adam Tauber

[fix] produce valid urls if scheme is missing

parent 8db527c1
...@@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url): ...@@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url):
if url.startswith('//'): if url.startswith('//'):
# add http or https to this kind of url //example.com/ # add http or https to this kind of url //example.com/
parsed_search_url = urlparse(search_url) parsed_search_url = urlparse(search_url)
url = parsed_search_url.scheme + url url = u'{0}:{1}'.format(parsed_search_url.scheme, url)
elif url.startswith('/'): elif url.startswith('/'):
# fix relative url to the search engine # fix relative url to the search engine
url = urljoin(search_url, url) url = urljoin(search_url, url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment