Python代理设置
def test3():
url = "Http://www.ip.cn"
proxy_handler = urllib2.ProxyHandler({'http' : 'http://username:passWord@host:port'})
opener = urllib2.build_opener(proxy_handler);
urllib2.install_opener(opener)
conn = urllib2.urlopen(url)
print conn.read()
相关文章