HTTPS 代理不适用于 Python 请求

问题描述

我在 proxies.txt 中获得了代理,并使用 ProxyManager 获得了一个随机代理。我也尝试使用这样的字典:

myProxy = {
    'http' : 'http://username:password@ip:port','https' : 'https://username:password@ip:port',}

然后是请求

url = "https://www.google,com/"
response = s.request("GET",url,headers=headers,proxies=myProxy)
print(response.text)

但我收到这些错误

OSError: [Errno 0] Error

During handling of the above exception,another exception occurred:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google,com',port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.',OSError(0,'Error')))

相反,如果我请求一个 http 网站,比如我拥有的个人域名,我会得到想要的响应。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)