1.代理服务器地址选择网址:http://www.xicidaili.com
import urllib.request
#代理服务器网址 "http://www.xicidaili.com"
proxy_handler = urllib.request.ProxyHandler({'http': '120.32.208.16:8118'})
opener = urllib.request.build_opener(proxy_handler)
r = opener.open('http://www.baidu.com')
print(r.read().decode('utf-8','ignore'))