0

I can't get the tokens cf_clearance and cf_duid on the sites protected by cloudflare in general using the cfscrape library. All I get is a cookie value that is None no matter which website I try to scrape.

More details on this module and cloudflare cookies here : https://github.com/Anorov/cloudflare-scrape

Python version is 3.10 and cfscrape version is 2.1.1

Here is the simple code used :

import cfscrape

url = 'https://tinyurl.com/'

token, agent = cfscrape.get_tokens(url, headers=headers)
token2, agent2 = cfscrape.get_cookie_string(url, headers=headers)
print(token)
print(token2)

Here is the answer no matter the website visited :

line 1 : {'__cfduid': '', 'cf_clearance': ''}
line 2 : __cfduid=; cf_clearance=

I made many calls and requests to the same pages just to see if it wasn't triggered after some time. 
I also tried with different headers, proxies and on several webpages from several sites protected by cloudflare. Can anyone tell me what I am doing wrong ? 
 
polo6767
  • 1
  • 2

0 Answers0