konstantinoskolios / spitogatos-scrapper

Driven by a desire to deepen my understanding of Python, I embarked on a project to build a platform scraper specifically designed for rental listings. This tool aims to efficiently gather and present rental information from various online sources, showcasing both the capabilities of Python and my growing proficiency in it.
MIT License
3 stars 0 forks source link

Issues with cfscrape (DEFAULT_CIPHERS ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_') #1

Open chriss2401 opened 3 months ago

chriss2401 commented 3 months ago

Hi! When trying to run spitogatosscraper.py with the suggested commands, I get the following error message:

Traceback (most recent call last): File "/mnt/c/repos/spitogatos-scrapper/spitogatosscraper.py", line 2, in <module> import cfscrape File "/home/chris2401/miniconda3/envs/spitogatos-scrapper/lib/python3.12/site-packages/cfscrape/__init__.py", line 19, in <module> from urllib3.util.ssl_ import create_urllib3_context, DEFAULT_CIPHERS ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/home/chris2401/miniconda3/envs/spitogatos-scrapper/lib/python3.12/site-packages/urllib3/util/ssl_.py)

It seems like it is an issue with the cfscrape package (https://github.com/Anorov/cloudflare-scrape/issues/465), and even though a patch has been made, there is no release with it. I don't know whether an alternative could be used ?

chriss2401 commented 3 months ago

It seems that if you change the __init__.py file of cfscrape manually with the recommended solution in the link provided above everything works ok. If the maintainer there releases a new version then that should close this issue. By the way, I think you are missing cfscrape in your requirements.txt file.