Skip to content

Commit 9eae3e5

Browse files
committed
Support Cloudflare's new Server header
1 parent 7e7360d commit 9eae3e5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cfscrape/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def request(self, method, url, *args, **kwargs):
4040

4141
# Check if Cloudflare anti-bot is on
4242
if ( resp.status_code == 503
43-
and resp.headers.get("Server") == "cloudflare-nginx"
43+
and resp.headers.get("Server", "").startswith("cloudflare")
4444
and b"jschl_vc" in resp.content
4545
and b"jschl_answer" in resp.content
4646
):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'cfscrape',
55
packages = ['cfscrape'],
6-
version = '1.9.0',
6+
version = '1.9.1',
77
description = 'A simple Python module to bypass Cloudflare\'s anti-bot page. See https://github.com/Anorov/cloudflare-scrape for more information.',
88
author = 'Anorov',
99
author_email = '[email protected]',

0 commit comments

Comments
 (0)