how to judge urllib.Request is finished?

oyster lepto.python at gmail.com
Tue Jul 1 03:16:03 EDT 2008


currently I am using
[code]
req=urllib2.Request(url)
data=''
if '</htm>' not in data:
        fd=urllib2.urlopen(req)
        data=fd.read()
        time.sleep(10)
time.sleep(10)
blahblah
[/code]

Is there any other ready-to-use function? And what if the internet
connection is chocked so that the html page can not be loaded
entirely?



More information about the Python-list mailing list