所以我试图绕过一个网站的 cloudflare 保护来从他们那里抓取一些项目,但Cloudscraper python 模块不起作用。
每当我运行它时,我都会收到此错误:
cloudscraper.exceptions.CloudflareChallengeError: Detected a Cloudflare version 2 challenge, This feature is not available in the opensource (free) version.
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的简化代码:
import cloudscraper
from bs4 import BeautifulSoup as soup
url = "http://adventurequest.life/"
scraper = cloudscraper.create_scraper()
html = scraper.get(url).text
page_soup = soup(html, "html.parser")
print(page_soup)
Run Code Online (Sandbox Code Playgroud)
你们知道如何解决这个问题吗?