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

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


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部