urllib question
Matthew Schinckel
baron at null.net
Sat Jul 8 00:42:29 EDT 2000
On Fri, 7 Jul 2000, Hans F. Updyke wrote:
> [snip]
>
> >u = urllib.urlopen(string.join(["http://cnn.com/",
> >"index.html"]))
> >print u.read()
Much better off using the urlparse module instead of string.join():
u = urllib.urlopen(urlparse.urljoin('http://cnn.com/','index.html'))
print u.read()
--
Matthew Schinckel <matt at null.net>
ARCHDUKE FERDINAND FOUND ALIVE --
FIRST WORLD WAR MISTAKE
More information about the Python-list
mailing list