question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cfscrape cannot solve captchas

See original GitHub issue

Hello! Is there any chance that somebody can help me? The server is a fresh instance set up specially for the test. Ubuntu 19.04 with nodejs installed. None of the python versions(2.7, 3.7) seems to solve the issue. Thanks for any help! Just in case I’ve attached the output from terminal Selection_002

Version number

Run pip show cfscrape and paste the output below: Name: cfscrape Version: 2.0.7 Summary: A simple Python module to bypass Cloudflare’s anti-bot page. See https://github.com/Anorov/cloudflare-scrape for more information. Home-page: https://github.com/Anorov/cloudflare-scrape Author: Anorov Author-email: anorov.vorona@gmail.com License: UNKNOWN Location: /usr/local/lib/python2.7/dist-packages Requires: requests Required-by:

Code snippet experiencing the issue

import cfscrape

scraper = cfscrape.create_scraper() print scraper.get(“https://www.enotes.com/topics/alpha/”).content

Complete exception and traceback

Traceback (most recent call last): File “test.py”, line 5, in <module> print (scraper.get(“https://www.enotes.com/topics/alpha/”).content) # => “<!DOCTYPE html><html><head>…” File “/usr/local/lib/python2.7/dist-packages/requests/sessions.py”, line 546, in get return self.request(‘GET’, url, **kwargs) File “/usr/local/lib/python2.7/dist-packages/cfscrape/init.py”, line 124, in request self.handle_captcha_challenge(resp, url) File “/usr/local/lib/python2.7/dist-packages/cfscrape/init.py”, line 147, in handle_captcha_challenge raise CloudflareCaptchaError(error, response=resp) cfscrape.CloudflareCaptchaError: Cloudflare captcha challenge presented for www.enotes.com (cfscrape cannot solve captchas)

URL of the Cloudflare-protected page

https://www.enotes.com/topics/alpha/

URL of Pastebin/Gist with HTML source of protected page

https://pastebin.com/CXKapc0B

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15

github_iconTop GitHub Comments

2reactions
956MBcommented, Jun 25, 2019

@pro-src I tried my script again after upgrading my OpenSSL from ‘1.1.1.a’ to ‘1.1.1.c’, and got the same captcha result, but after putting the ‘DEFAULT_CIPHERS’ line you recommended for @bajburtskii, it fixed my captcha issue

# import cfscrape

# One TLS v1.3 cipher and one TLS v1.2 cipher
cfscrape.DEFAULT_CIPHERS = 'TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES256-SHA384'

# scraper = cfscrape.create_scraper()
# print(scraper.get('https://www.enotes.com/topics/alpha/').text)
2reactions
ghostcommented, Jun 25, 2019

Sorry @bajburtskii

I’m unable to reproduce the problem, please see https://github.com/Anorov/cloudflare-scrape/issues/264 for a possible workaround.

You might also try setting only a couple of ciphers to avoid the CAPTCHA:

import cfscrape
# One TLS v1.3 cipher and one TLS v1.2 cipher
cfscrape.DEFAULT_CIPHERS = 'TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES256-SHA384'

scraper = cfscrape.create_scraper()
print(scraper.get('https://www.enotes.com/topics/alpha/').text)

Otherwise for further assistance, feel free to generate a report with this script.

This must be ran from within the cloned cloudflare-scrape repo if you haven’t pip installed cfscrape

git clone https://gist.github.com/pro-src/17654ec3f949b0b17bd1a4aa1b4136b9 temp
cp temp/report-enotes.py report.py

python2 report.py
python3 report.py
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bypass cloudflare with python cloudscraper
Checking your browser before accessing author.today. Is there any solution to bypass cloudflare in my case? python · web-scraping · cloudflare.
Read more >
https://raw.githubusercontent.com/Anorov/cloudflar...
You can potentially resolve this by increasing the challenge answer delay (default: ... captcha challenge presented for %s (cfscrape cannot solve captchas)" ...
Read more >
cfscrape - PyPI
cloudflare-scrape. A simple Python module to bypass Cloudflare's anti-bot page (also known as "I'm Under Attack Mode", or IUAM), implemented with Requests.
Read more >
py-cfscrape - pkgsrc.se | The NetBSD package collection
www/py-cfscrape, Python module for dealing with Cloudfare protection ... to resolve issues with some users reporting \ receiving Cloudflare captchas.
Read more >
ccxt-dev/ccxt - Gitter
@LohithBlaze you can use a cloudflare scraper or cfscraper to solve that captcha for you automatically (however, it can fail as well). LohithBlaze....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found