-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: could not convert string to float: b'undefined' #241
Comments
I haven't really taken a good look at this yet but I did add the HTML source as a test fixture. It passes on python 2 and 3 so it's not immediately clear to me as to what is causing the problem. git clone --single-branch --branch issue_241 https://github.com/pro-src/cloudflare-scrape issue_241
cd issue_241
pip install pytest responses sure
pytest tests ` |
Well the HTML is not necessarily what cfscrape sees, since cfscrape does not output the HTML code. The pastebin merely contains the output of a parallel Are you saying you cannot reproduce this? cfscrape 2.0.3 worked fine for me until at least May 12th, 18:10 UTC and started to fail at 19:10 UTC, so I assume cloudflare changed something and cfscrape is broken for everyone? |
@lukastribus I'm able to reproduce this error when using a very old version of Node.js v4. If Cloudflare updates usually they'll be a ton of issues flooding into multiple repositories. The most recent version uses more robust methods so maybe not...
This works properly on any security patched version of v4 and all versions in between v4 and the most recent Node.js In conclusion, you should upgrade your version of Node.js. Please read https://github.com/Anorov/cloudflare-scrape#nodejs-dependency |
Thanks for the analysis. This is Ubuntu 16.04 (xenial) - which is supported until 2021 and the latest nodejs package |
You're welcome. The security vulnerability was discovered by @feross and other webtorrent contributors. He created this package until the Node.js team had time to backport the proposed fix, also noted here. He raised the Node.js issue here: nodejs/node#4660 CVE-2018-7166 <- (Might just be related) |
@lukastribus There is no support for v4, v6, v7 or earlier versions even if the Node.js team does receive reports about security vulernabilities, nothing will be done (No support). Information on all security updates: https://nodejs.org/en/blog/vulnerability/ I would upgrade to bionic(18.04LTS): https://packages.ubuntu.com/search?keywords=nodejs But I don't like Ubuntu so... I use Kali. |
Ok, that works, thanks. Still don't really understand how this could brake cfscrape 2.0.3 from one moment to the other, only by changes on the cloudflare side. As we suggest in README that Debian and Ubuntu users can you just Can I assume that a PR updating README in that regard would be welcome? |
@lukastribus Absolutely, please send one! Also, if we could pin point the exact minimum Node.js version and add that to the README with a note recommending people not to use unsupported Node.js versions for security reasons. Or simply noting v4.9.1 as being the minimum version that is known to work with cfscrape. Just suggestions. 😃 |
The IUAM JS challenge can vary from domain to domain, some domains might be locked to an older challenge. The challenges can change on a per request basis as well as the number of challenges required to solve and how often you receive those challenges with/without the cookie. Usually the changes are negligible on a per request basis but in some cases... This library aims to maintain compatibility with all challenge versions that are currently in play. |
This has been backported to 4.5, and first released in 4.5.0. Confirmed by this PR here: So at least node 4.5 is required. Which explains why Ubuntu Xenial (4.2.6) is broken but Debian Stretch (4.8.2) works. Will send a PR for this later. |
As discussed in Anorov#241
Hi, you can easily install Node v10.16.0 on Ubuntu 16.04.06 LTS server using the library download here : https://nodejs.org/en/download/ works for me. vm01: vm01:~/tmp$ pip3 show cfscrape Metadata-Version: 2.1 |
Version number
Code snippet experiencing the issue
Complete exception and traceback
(If the problem doesn't involve an exception being raised, leave this blank)
URL of the Cloudflare-protected page
https://pro-src.com/
URL of Pastebin/Gist with HTML source of protected page
https://pastebin.com/K0LX8KDT
The text was updated successfully, but these errors were encountered: