Anorov / cloudflare-scrape

A Python module to bypass Cloudflare's anti-bot page.
MIT License
3.33k stars 456 forks source link

cfscrape version 2.1.1 Is still an error #399

Open ghost opened 3 years ago

ghost commented 3 years ago

import cfscrape

实例化一个create_scraper对象

scraper = cfscrape.create_scraper()

请求报错,可以加上时延

scraper = cfscrape.create_scraper(delay = 30)

获取网页源代码

web_data = scraper.get("https://wallhere.com/")

Traceback (most recent call last): File "/Users/xuqiang/Desktop/project/python/RegistrationManagementSystem/utils/test1.py", line 18, in web_data = scraper.get("https://wallhere.com/") File "/Users/xuqiang/Desktop/project/python/RegistrationManagementSystem/venv/lib/python3.7/site-packages/requests/sessions.py", line 546, in get return self.request('GET', url, kwargs) File "/Users/xuqiang/Desktop/project/python/RegistrationManagementSystem/venv/lib/python3.7/site-packages/cfscrape/init.py", line 129, in request resp = self.solve_cf_challenge(resp, kwargs) File "/Users/xuqiang/Desktop/project/python/RegistrationManagementSystem/venv/lib/python3.7/site-packages/cfscrape/init.py", line 204, in solve_cf_challenge answer, delay = self.solve_challenge(body, domain) File "/Users/xuqiang/Desktop/project/python/RegistrationManagementSystem/venv/lib/python3.7/site-packages/cfscrape/init.py", line 292, in solve_challenge % BUG_REPORT ValueError: Unable to identify Cloudflare IUAM Javascript on website. Cloudflare may have changed their technique, or there may be a bug in the script.

Please read https://github.com/Anorov/cloudflare-scrape#updates, then file a bug report at https://github.com/Anorov/cloudflare-scrape/issues."

Process finished with exit code 1

hirios commented 3 years ago

Me too