← Back to CF Bypass

Scrape Sites Behind Cloudflare with Python requests (No Selenium)

Updated November 2026 · 5 min read

You're on a deadline. You write requests.get(url), and you get back a 403 with a "Checking your browser" page. You Google "Cloudflare bypass" and get buried in Selenium tutorials that require you to install Chromium on a server that has 2 GB of RAM. There's a simpler way.

Why plain requests fails

Cloudflare checks four things on every request:

You can't fake all four from plain Python. That's why every "pure requests Cloudflare bypass" library on GitHub is dead within 3 months — Cloudflare patches it.

The 3-line solution

Use a bypass API as a drop-in replacement for the origin. It handles all four checks for you and returns raw HTML exactly as the origin sent it.

import requests

resp = requests.post(
    "https://cloudflare-bypass.shop/v1/solve",
    headers={"X-API-Key": "YOUR_KEY"},
    json={"url": "https://target.com"},
    timeout=200
)
print(resp.status_code, len(resp.text))

That's it. resp.text is the raw page. If the target is an image or PDF, resp.content gives you bytes. The Content-Type header matches the origin. No JSON wrapper, no base64 encoding.

Full working example

import requests

API = "https://cloudflare-bypass.shop/v1/solve"
KEY = "YOUR_KEY"

def fetch(url):
    r = requests.post(
        API,
        headers={"X-API-Key": KEY},
        json={"url": url},
        timeout=200
    )
    if r.status_code == 200 and len(r.text) > 10000:
        return r.text
    raise RuntimeError(f"Failed: {r.status_code}, len={len(r.text)}")

html = fetch("https://www.example.com/protected-page")
print(html[:500])

The ">10,000 characters" trick

Here's the single most useful rule in scraping: if the response is 200 OK and the body is longer than 10,000 characters, you almost certainly got the real page. Cloudflare's interstitial is a few hundred bytes. Empty pages are a few hundred. Real pages are tens of thousands. Stop debugging, start parsing.

Warning: don't waste hours inspecting a 200 OK response for "problems". If status is 200 and the body is large, you got the page. Move on.

Handling 404s and failures

A good bypass API distinguishes between:

CF Bypass follows exactly this model: $0.03 per success, $0.01 per 404, refund on failure. So you never pay for a page that didn't exist.

When you actually do need Selenium

Sometimes you need the page after JavaScript runs — for infinite scroll, clicking buttons, or executing site JS. That's a different problem. Bypass APIs usually offer a JS rendering option, or you can run Playwright with a residential proxy. But for 90% of scraping tasks, fetching raw HTML is enough — most sites still render useful content server-side.

Try CF Bypass free: get a key at cloudflare-bypass.shop. Pay in USDT/USDC, no subscription.

Common errors and fixes

ErrorCauseFix
403 from APIInvalid or expired API keyRegenerate key, check balance
402 / no balanceWallet not topped upSend USDT/USDC, wait 2 min
TimeoutTarget hung or Cloudflare stuckRetry once; if again, target is down
Small bodyTarget returned a real short pageCheck status, not length

Frequently Asked Questions

Can I bypass Cloudflare with plain Python requests?

Not directly. Cloudflare fingerprints your TLS handshake, HTTP/2 settings and IP reputation, and the standard requests library fails all three. You need a bypass API that handles these on its side and returns raw HTML.

Do I need Selenium or Playwright?

No, for most scraping tasks you don't. Selenium and Playwright are only needed when the page requires interaction after JavaScript runs. For fetching raw HTML, a bypass API is faster and cheaper.

How much does a bypass request cost?

CF Bypass charges $0.03 per successful bypass, $0.01 for a 404, and refunds failures. You never pay for a page that did not load.

How do I know the response is a real page and not a stub?

Check for a 200 OK status, a body longer than 10,000 characters, and a matching Content-Type. If all three match, you got the real page. Do not search the HTML for the word "cloudflare" — every protected page contains it.

Related: Python guide · ZenRows alternatives · Scrapy + Cloudflare · API comparison 2026