首页 > 编程语言 > 详细

Python代理设置

时间:2015-09-23 19:35:00      阅读:235      评论:0      收藏:0      [点我收藏+]
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()


Python代理设置

原文:http://duallay.blog.51cto.com/635999/1697537

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!