1
2
3
4
5
6
7
|
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()
|
本文转自fatshi51CTO博客,原文链接:http://blog.51cto.com/duallay/1697537 ,如需转载请自行联系原作者