python requests 报错 Caused by ProxyError ('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Tunnel or SSL Forbidden'))
背景:访问https接口,使用http代理
版本:requests: 2.31.0
从报错可以看出,是proxy相关的报错
调整代码,设定不使用代理,将http与https对应的proxy值置空即可(尝试过proxies = {},但此写法不生效)
proxies = {
'http': '',
'https': ''
}
response
=
requests.get(
'https://xxxx'
, proxies
=proxies
, verify
=
False
)