urllib3.ProxyManager正在进行身份验证

2024-04-23 19:39:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用urllib3.ProxyManager发送https请求。 我的代码看起来像这样

default_headers = urllib3.util.make_headers(proxy_basic_auth='user:passwd')
http = urllib3.ProxyManager(proxyUrl, headers=default_headers, ca_certs=certifi.where())
http.request('GET', url)

我在错误下面-

MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='clinicaltrials.gov', port=443): Max retries exceeded with url: /ct2/results?term=Lilly&displayxml=true&count=5000 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))

谢谢你, 雅特里克


Tags: 代码httpsauthhttpdefaulturlmakebasic