proxy check1 Python Proxy check import urllib2, socket socket.setdefaulttimeout(180) # read the list of proxy IPs in proxyListproxyList = ['172.30.1.1:8080', '172.30.3.3:8080'] # there are two sample proxy ip def is_bad_proxy(pip): try: proxy_handler = urllib2.ProxyHandler({'http': pip}) opener = urllib2.build_opener(proxy_handler) opener.addheaders = [('User-agent', 'Mozilla/5.0')] urllib2.install_opener(opener) req=urllib2.R.. 2016. 1. 30. 이전 1 다음