urllib IOError Exception

JanC usenet_spam at janc.invalid
Fri Jun 11 14:02:23 EDT 2004


Bart Nessux <bart_nessux at hotmail.com> schreef:

>         try:
>            f = urllib2.urlopen("http://%s" %host)
>         except urllib2.URLError:
>            print host, "has no http server on  port 80"
> 
> Anyway to speed this up??? The timeout per host is several minutes.

socket.setdefaulttimeout(timeout)

<http://docs.python.org/lib/module-socket.html>

-- 
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9



More information about the Python-list mailing list