通过代理ip访问
#通过代理ip访问
from urllib import request
proxy = {
'http':'https://219.141.153.41:80'
}
# 实例 一个操作(储存代理ip)
handler = request.ProxyHandler(proxy)
# 实例 request对象 opener(绑定以上操作)
opener = request.build_opener(handler)
# 访问path
url = 'https://www.baidu.com/s?wd=ip'
# 获取回应
response = opener.open(url)
html_bytes = response.read()
print(html_bytes)#通过代理ip访问
from urllib import reques