一个请求通过 fiddler 走了代理,能请求,但是另一个用 requests 自带的配置走代理请求,就失败 有大佬知能给指点指点不?
1
cy1027 OP 我两次请求用了同样的其它参数,唯一不同的就是一个请求用 requests 自带的 proxies 添加了代理,另外一个用 fiddler 的 gateway 功能走了代理,两种方式走的是同一个代理
|
2
dicc 233 天前
你代码写错了
|
3
tanjnr 233 天前 via iPhone
你代码写错了+1
|
4
hlpureboy 233 天前
估计代码写错惹
|
5
whattime 233 天前
http_proxy = "http://127.0.0.1:1081"
https_proxy = "http://127.0.0.1:1081" ftp_proxy = "ftp://127.0.0.1:1081" proxyDict = { "http" : http_proxy, "https" : https_proxy, "ftp" : ftp_proxy } |
![]() |
6
610915518 233 天前
无代码无真相
|
7
mekingname 233 天前
他肯定是把 https 的代理的 scheme 写成 https 了。大多数代理网站都不提供 https 的代理。requests 的 proxies 字典里面,https 这个 key 对应的 value ,也应该是 http://开头。
|
8
nyxsonsleep 233 天前
@mekingname #7 我印象中是 python 不同库有好几种写法。
比如不能加 http 头的 proxy 。都要 http 头的 proxy 。分别要 http 和 https 头的 proxy 。 |
![]() |
9
kokutou 233 天前 via Android
我记得有个 bug 被修了,Python 和包都更新最新,然后再试试?
|