开发者

Help with urllib + proxy in Python

开发者 https://www.devze.com 2023-01-06 04:41 出处:网络
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?

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})
0

精彩评论

暂无评论...
验证码 换一张
取 消