python3 使用代理


#代理使用
>>> proxy_handler=urllib.request.ProxyHandler({'http':'211.81.31.18:8081'})
>>> opener=urllib.request.build_opener(proxy_handler)
>>> urllib.request.install_opener(opener)
>>> page=urlopen('http://ip.chinaz.com/getip.aspx')
>>> print(page.read().decode('utf-8'))
{ip:'221.238.67.231',address:'天津市 电信'}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM