Change ip to visit.
url=“http://www.baidu.com”
First: set the proxy address
proxy = { "http": "120.185.18.90.01"} # Dictionary new IP address written in the form
Second: Create proxyheadler
proxy_handler =request.Proxyheadler(proxy)
Third: Creating Opener
opener = request.bulid_opener(proxy_handler)
Fourth: Install opener
request.install_opener(opener)