cloudscraper和代理的网络抓取问题



我对使用cloudscraper的代理服务器有问题。

简单程序:

proxy_list = {"http": "http://username:password@ip.my.proxy:port"}
scraper = cloudscraper.create_scraper()
print(scraper.get("https://api.ipify.org/", proxies=proxy_list))
exit()

这个简单的程序总是显示我的IP地址没有使用代理服务器。为什么?我尝试了多个(工作的(代理服务器,运行时没有错误,而且总是不工作。有什么建议吗?

I更改:

proxy_list = {"http": "http://username:password@ip.my.proxy:port"}
to
proxy_list = {"https": "http://username:password@ip.my.proxy:port"}

现在一切都很好,但我不知道为什么。

您必须为http和https 设置代理

proxy_list = {"http": "http://username:password@ip.my.proxy:port", "https": "http://username:password@ip.my.proxy:port"}

最新更新