requests模块使用代理
作者:互联网
找一个免费IP的网站
# coding=utf-8
import requests
proxies = {"http":"http://114.234.80.188:80"}#就代理填到这里
headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"}
r = requests.get("http://www.baidu.com",proxies=proxies,headers=headers)
print(r.status_code)
标签:http,代理,headers,537.36,模块,requests,proxies 来源: https://www.cnblogs.com/SunChuangYu/p/13235184.html