python版本:3.9.4
requests版本:2.28.2
詳細(xì)報(bào)錯如下
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',
}
使用如下代理設(shè)置,報(bào)錯得到解決
proxies = {
'http': 'http://xxxx',
'https': 'http://xxxx',
}
總結(jié):由于之前使用的是python3.6.8版本,代理設(shè)置為’https’: 'https://xxxx’可以正常使用,而升級到python3.9.4則出現(xiàn)了上述問題。建議代理的使用統(tǒng)一為 ‘https’: ‘http://xxxx’文章來源:http://www.zghlxwxcb.cn/news/detail-613774.html
參考:https://blog.csdn.net/m0_53354532/article/details/127310729文章來源地址http://www.zghlxwxcb.cn/news/detail-613774.html
到了這里,關(guān)于爬蟲requests使用代理報(bào)錯Your proxy appears to only use HTTP and not HTTPS...的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!