python采集遇到cloudflare
1.requests请求遇到如下问题
Access denied | xxx.com used Cloudflare to restrict access
2.解决
pip install cloudscraper
import cloudscraper scraper = cloudscraper.create_scraper() print(scraper.get("https://study1moose.com/the-notebook-analysis-essay").text)
参考:https://awesomeopensource.com/projects/cloudflare-bypass?categoryPage=47