
浏览器请求没问题,但是用代码请求时就会报错!
Checking if the site connection is secure
XXXXX needs to review the security of your connection before proceeding.
解决办法
pip install cloudscraper
import cloudscraper
scraper = cloudscraper.create_scraper()
resp = scraper.get('目标网站').text
和requests 请求一样
解决Python代码请求网站安全问题
当使用Python代码请求网站时遇到安全连接问题,可以尝试使用`cloudscraper`库来替代`requests`。安装`cloudscraper`后,创建 scraper 对象并进行请求操作,以确保能安全地获取目标网站内容。
2774

被折叠的 条评论
为什么被折叠?



