MCPcopy Index your code
hub / github.com/HasData/cloudflare-bypass

github.com/HasData/cloudflare-bypass @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8 symbols 40 edges 12 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Python Node.js

Cloudflare 1020 Bypass Examples (Python & Node.js)

HasData_bannner

This repo contains working examples of bypassing Cloudflare 1020 errors using Playwright + Stealth with residential proxies, rotating headers, and basic anti-bot evasion tricks. Works in Node.js and Python.

Table of Contents

  1. Requirements
  2. Project Structure
  3. Bypass Examples
  4. Playwright Basic
  5. Playwright + Stealth
  6. Residential Proxy Rotation
  7. User-Agent + Header Spoofing
  8. Human-like Behavior
  9. Full Flow Example

Requirements

Python 3.10+ or Node.js 18+

Python Setup

Required packages:

  • requests
  • playwright
  • playwright-stealth

Install:

pip install playwright
playwright install
pip install playwright-stealth

Node.js Setup

Required packages:

  • playwright
  • playwright-extra
  • playwright-extra-plugin-stealth

Install:

npm install playwright playwright-extra playwright-extra-plugin-stealth

Project Structure

cf1020-bypass-examples/
│
├── python/
│   ├── basic_playwright.py
│   ├── stealth_playwright.py
│   ├── proxy_rotation.py
│   ├── header_rotation.py
│   ├── human_behavior.py
│   ├── full_flow_example.py
│
├── nodejs/
│   ├── basic_playwright.js
│   ├── stealth_playwright.js
│   ├── proxy_rotation.js
│   ├── header_rotation.js
│   ├── human_behavior.js
│   ├── full_flow_example.js
│
└── README.md

Each script shows a different tactic for avoiding Cloudflare 1020. No frameworks, no noise — just straight working examples.

Bypass Examples

Playwright Basic

Basic page load using vanilla Playwright (likely to trigger CAPTCHA or 1020). | Parameter | Description | Example | | ------------- | ---------------------- | ----------------------- | | url | Target URL to load | 'https://example.com' | | timeout | Maximum wait time (ms) | 60000 | | output_file | File to save page HTML | 'page.html' |

Playwright + Stealth

Hide webdriver flag, spoof plugins, patch headless indicators.

Parameter Description Example
target_url URL to visit and scrape 'https://example.com'
headless Run browser in headless mode True
timeout Maximum wait time (ms) 60000

Residential Proxy Rotation

Add a pool of rotating residential proxies for better IP reputation.

Parameter Description Example
target_url URL to visit with rotating headers 'https://example.com'
user_agents List of User-Agent strings to rotate ['Mozilla/5.0...', 'Chrome/91.0...']
extra_headers Additional HTTP headers to include (optional) {'Accept-Language': 'en-US,en;q=0.9'}
rotate_every Number of requests before changing header 1 (rotate every request)

User-Agent + Header Spoofing

Randomized headers and modern user agents for each session. | Parameter | Description | Example | | ------------- | ---------------------------------------- | --------------------------------------- | | target_url | URL to visit with rotated headers | 'https://example.com' | | user_agents | List of User-Agent strings to rotate | ["Mozilla/5.0...", "Safari/537.36"] | | headers | Additional HTTP headers to include | {"Accept-Language": "en-US,en;q=0.9"} | | proxy | Proxy server address (optional) | 'http://user:pass@proxy.com:8080' | | timeout | Max time to wait for page load (seconds) | 30 |

Human-like Behavior

Add mouse movement, scrolling, and timed delays. | Parameter | Description | Example | | ----------------------------- | --------------------------- | -------------------------------------------- | | page | Playwright page object | page.goto('https://example.com') | | sleep | Pause execution for realism | time.sleep(1.5) / await sleep(1500) (ms) | | mouse.move(x, y) | Move mouse cursor to (x, y) | page.mouse.move(100, 100) | | mouse.click(x, y) | Click at coordinates (x, y) | page.mouse.click(200, 300) | | keyboard.press(key) | Simulate keyboard key press | page.keyboard.press('PageDown') | | mouse.wheel(deltaX, deltaY) | Scroll page by delta | page.mouse.wheel(0, 400) |

Full Flow Example

All combined: stealth, headers, proxies, behavior — in one script.

Parameter Description Example
proxy Proxy server URL with auth 'http://user:pass@proxy.example:8000'
user_agent Browser user agent string 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...'
target_url URL to navigate and scrape 'https://example.com'
headless Whether to run browser in headless mode True (Python) / true (Node.js)
delay_range Range (seconds) for random delays between actions 0.5 to 2 seconds

Disclaimer

These examples are for educational purposes only. Learn more about the legality of web scraping.

📎 More Resources

Core symbols most depended-on inside this repo

sleep
called by 5
NodeJS/human_behavior.js
sleep
called by 3
NodeJS/full_flow_example.js
human_behavior
called by 1
Python/human_behavior.py
main
called by 1
Python/human_behavior.py
human_like_interaction
called by 1
Python/full_flow_example.py
main
called by 1
Python/full_flow_example.py
humanBehavior
called by 1
NodeJS/human_behavior.js
humanLikeInteraction
called by 1
NodeJS/full_flow_example.js

Shape

Function 8

Languages

TypeScript50%
Python50%

Modules by API surface

Python/human_behavior.py2 symbols
Python/full_flow_example.py2 symbols
NodeJS/human_behavior.js2 symbols
NodeJS/full_flow_example.js2 symbols

For agents

$ claude mcp add cloudflare-bypass \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact