Skip to content

ValueError: could not convert string to float: b'undefined' #241

@lukastribus

Description

@lukastribus

Version number

$ pipenv run pip show cfscrape
Name: cfscrape
Version: 2.0.3
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: [email protected]
License: UNKNOWN
Location: /home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages
Requires: requests
Required-by:
$

Code snippet experiencing the issue

import cfscrape
cfscrape.create_scraper().get('https://pro-src.com/')

Complete exception and traceback

(If the problem doesn't involve an exception being raised, leave this blank)

>>> cfscrape.create_scraper().get('https://pro-src.com/')
Traceback (most recent call last):
  File "/home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages/cfscrape/__init__.py", line 267, in solve_challenge
    float(result)
ValueError: could not convert string to float: b'undefined'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages/cfscrape/__init__.py", line 108, in request
    resp = self.solve_cf_challenge(resp, **kwargs)
  File "/home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages/cfscrape/__init__.py", line 154, in solve_cf_challenge
    answer, delay = self.solve_challenge(body, domain)
  File "/home/user/.local/share/virtualenvs/project1-4cV4hs0c/lib/python3.5/site-packages/cfscrape/__init__.py", line 270, in solve_challenge
    "Cloudflare IUAM challenge returned unexpected answer. %s" % BUG_REPORT
ValueError: Cloudflare IUAM challenge returned unexpected answer. 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."
>>>

URL of the Cloudflare-protected page

https://pro-src.com/

URL of Pastebin/Gist with HTML source of protected page

https://pastebin.com/K0LX8KDT

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdated depsErrors associated with using an old peer dependency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions