cloudflare-scrape: 2.0.1 and 2.0.2 crashes opening user_agents.json

The pip installation does not ship user_agents.json therefor, cfscrape (2.0.1 and 2.0.2) crashes:

mkdir cfscrapetest
cd cfscrapetest/
pipenv --three
pipenv install cfscrape
pipenv run python
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cfscrape
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/share/virtualenvs/cfscrapetest-uMJOQPOp/lib/python3.5/site-packages/cfscrape/__init__.py", line 22, in <module>
    with open(USER_AGENTS_PATH) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/share/virtualenvs/cfscrapetest-uMJOQPOp/lib/python3.5/site-packages/cfscrape/user_agents.json'
>>>

@Anorov @pro-src

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

This is fixed in the latest version. Please upgrade with pip install -U cfscrape.