1. import requests
    2. url = "https://www.baidu.com/s?wd=ip"
    3. headers = {
    4. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
    5. }
    6. page_text=requests.get(url=url,headers=headers,proxies={"http":'49.85.18.48:9999'}).text
    7. with open("ip.html", "w", encoding="utf-8") as f:
    8. f.write(page_text)