import urllib.request as ur proxy_address = ur.urlopen('http://api.ip.data5u.com/dynamic/get.html?order=d314e5e5e19b0dfd19762f98308114ba&sep=4').read().decode('utf-8').strip()
print(proxy_address) # 创建proxy_handler
proxy_handler = ur.ProxyHandler(
{
'http':proxy_address
}
)
# 新建opener对象
proxy_opener = ur.build_opener(proxy_handler) request = ur.Request(url='https://edu.csdn.net/')
reponse = proxy_opener.open(request).read()
print(reponse)