Help with urllib + proxy in Python
My program isn't running properly as should be开发者_开发知识库...
I'm getting only the error message (except part) of the urlopen with the proxy... why? At least, one of the proxy was tested and work correctly...
please, some one take a look on the code here: http://pastebin.com/cBfv5H8J
edit:
the code doesn't work on the first try part, this one
try:
h = urllib.urlopen(website, proxies = {'http': proxylist})
break
and always return me the
except:
print '['+time.strftime('%Y/%m/%d %H:%M:%S')+'] '+'ERROR. Trying again... (%s)' % proxy
time.sleep(1)
At least one error:
h = urllib.urlopen(website, proxies = {'http': proxylist})
Should be
h = urllib.urlopen(website, proxies = {'http': proxy})
精彩评论