爬虫requests使用代理报错Your proxy appears to only use HTTP and not HTTPS...

2023-05-16

python版本:3.9.4
requests版本:2.28.2
详细报错如下

Max retries exceeded with url: / (Caused by ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP```

代理使用如下:

proxies = {
    'http': 'http://xxxx',
    'https': 'https://xxxx',
}

使用如下代理设置,报错得到解决


proxies = {
    'http': 'http://xxxx',
    'https': 'http://xxxx',
}

总结:由于之前使用的是python3.6.8版本,代理设置为’https’: 'https://xxxx’可以正常使用,而升级到python3.9.4则出现了上述问题。建议代理的使用统一为 ‘https’: ‘http://xxxx’

参考:https://blog.csdn.net/m0_53354532/article/details/127310729

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

爬虫requests使用代理报错Your proxy appears to only use HTTP and not HTTPS... 的相关文章

随机推荐