I have a list of URL's
I am using the following to retrieve their contents:
for url in url_list:
req = urllib2.Request(url)
resp = urllib2.urlopen(req, timeout=5)
resp_page = resp.read()
print resp_page
When there is a timeout, the program just crashes. I just want to read the next URL if there is a socket.timeout: timed out
. How to do this?
Thanks