查询我的电脑的IP
import urllib.requesturl='http://www.whatismyip.com.tw'
proxy_support=urllib.request.ProxyHandler({'http:119.6.144.73:81'})
opener=urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)
response=urllib.request.urlopen(url)
html=response.read().decode('utf-8')
print(html)
这个程序运行的时候出错了,
AssertionError: proxies must be a mapping
什么原因啊?问题出在哪? 报错很明显啊,这里错了
proxy_support=urllib.request.ProxyHandler({'http':'119.6.144.73:81'}) 'http://119.6.144.73:81'
去看看http协议吧 我发布的主题里面有实际例子。 笨鸟学飞 发表于 2021-3-29 14:30
报错很明显啊,这里错了
proxy_support=urllib.request.ProxyHandler({'http':'119.6.144.73:81'})
怎么修改啊?我改了好几次都不行
页:
[1]