Python requests设置代理

首先设置代理地址:

proxies = {
    "http": "http://10.10.1.10:3128",
    "https": "http://127.0.0.1:8888",
}

对请求参数进行设置:

login = requests.get(login_url, headers=headers, proxies=proxies, verify=r"./FiddlerRoot.pem")

在此次代理中使用的是Fiddler进行抓包,链接为https,需要将Fiddler生成的证书修改为.pem格式

posted @ 2022-03-06 12:46  cccht  阅读(396)  评论(0)    收藏  举报