Moro, Andrea via Python-list wrote:
> Hello there,
>
> I believe there is a bug in the urljoin library.
I believe this is a case of garbage-in garbage-out ;)
Try
p = urlparse(url)
if not p.scheme:
url = urlunparse(p._replace(scheme="http"))
>
> See below:
&g
Hello there,
I believe there is a bug in the urljoin library.
See below:
p = urlparse(url)
if p.scheme == '':
url = urljoin('http://', url)
Input:
domain.tld/somepath
Output
http:///domain.tld/somepath
p = urlparse(url)
if p.scheme == '':
url = urljoin(