Fetching websites with Python

f29 f29 at gazeta.pl
Thu Apr 1 07:24:59 EST 2004


> > Markus,
> >     I think there's a timeout in urllib; not sure.
> 
> No there isn't, bit of a shame that. There is in httplib.

Sure there is, use urllib or urllib2 as usual, but also import socket
module and call "socket.setdefaulttimeout(secs)" before requesting any
pages with urlopen.

f29



More information about the Python-list mailing list