Bypass Cloudflare with Puppeteer
Stop getting blocked by Cloudflare. Bypass Turnstile challenges, bot detection, and WAF rules automatically with stealth Puppeteer in the cloud.
The Cloudflare Problem
Cloudflare protects over 20% of all websites, making web scraping and automation increasingly difficult
- ×Interactive challenges that stop headless browsers
- ×Device fingerprinting detects automation tools
- ×Behavioral analysis flags bot-like patterns
- ×WebDriver detection blocks automated browsers
- ×IP reputation blocking from cloud providers
- ×Rate limiting stops scraping at scale
The Browserless Solution
Run Puppeteer with built-in Cloudflare bypass - no configuration needed
Simple Puppeteer Integration
Just change your WebSocket endpoint - Cloudflare bypass is automatic
import puppeteer from 'puppeteer';
// This will likely be blocked by Cloudflare
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox']
});
const page = await browser.newPage();
// Cloudflare detects headless Chrome and shows challenge page
await page.goto('https://cloudflare-protected-site.com');
// Script fails or gets blocked
const content = await page.content();
await browser.close();import puppeteer from 'puppeteer-core';
// Turnstile solving on, with a timeout long enough for a solve to finish
const browser = await puppeteer.connect({
browserWSEndpoint: 'wss://production-sfo.browserless.io?token=YOUR_API_KEY&solveCaptchas=true&timeout=300000'
});
const page = await browser.newPage();
const cdp = await page.createCDPSession();
// Browserless reports a detected challenge, then the result of its background solve
const challengeFound = new Promise((resolve) =>
cdp.once('Browserless.captchaFound', () => resolve(true))
);
const challengeSolved = new Promise((resolve) =>
cdp.once('Browserless.captchaAutoSolved', resolve)
);
await page.goto('https://cloudflare-protected-site.com', {
waitUntil: 'networkidle2',
timeout: 60000,
});
// Detection can land just after navigation settles, so allow a few seconds for it.
// If a challenge was served, read the page only once the solve succeeds.
const found = await Promise.race([
challengeFound,
new Promise((resolve) => setTimeout(() => resolve(false), 5000)),
]);
if (found) {
const { solved, error } = await challengeSolved;
if (!solved) throw new Error(error || 'Challenge was not solved');
}
// Read the protected content
const content = await page.content();
console.log('Successfully bypassed Cloudflare!');
await browser.close();import puppeteer from 'puppeteer-core';
// Stealth mode means fewer challenges are served in the first place
const browser = await puppeteer.connect({
browserWSEndpoint:
'wss://production-sfo.browserless.io?token=YOUR_API_KEY&stealth=true&solveCaptchas=true&timeout=300000'
});
const page = await browser.newPage();
const cdp = await page.createCDPSession();
// Browserless reports a detected challenge, then the result of its background solve
const challengeFound = new Promise((resolve) =>
cdp.once('Browserless.captchaFound', () => resolve(true))
);
const challengeSolved = new Promise((resolve) =>
cdp.once('Browserless.captchaAutoSolved', resolve)
);
// Set a realistic viewport
await page.setViewport({ width: 1920, height: 1080 });
await page.goto('https://cloudflare-protected-site.com', {
waitUntil: 'networkidle2',
timeout: 60000,
});
// Detection can land just after navigation settles, so allow a few seconds for it.
// If a challenge was served, read the page only once the solve succeeds.
const found = await Promise.race([
challengeFound,
new Promise((resolve) => setTimeout(() => resolve(false), 5000)),
]);
if (found) {
const { solved, error } = await challengeSolved;
if (!solved) throw new Error(error || 'Challenge was not solved');
}
// Extract data after the challenge clears
const data = await page.evaluate(() => {
return {
title: document.title,
content: document.body.textContent
};
});
console.log('Data extracted:', data);
await browser.close();// Use Browserless REST API to bypass Cloudflare
const response = await fetch('https://production-sfo.browserless.io/content', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
url: 'https://cloudflare-protected-site.com',
waitFor: 'networkidle2',
stealth: true
})
});
const html = await response.text();
console.log('Successfully bypassed Cloudflare:', html);Why Choose Browserless for Cloudflare Bypass?
Production-ready Cloudflare bypass for Puppeteer at scale
How Cloudflare Bypass Works
Multi-layered approach to defeat Cloudflare's bot detection
Cloudflare analyzes dozens of browser properties to detect automation. We randomize and sanitize fingerprints including user agent, screen resolution, WebGL renderer, audio context, fonts, plugins, and timezone. WebDriver flags are removed completely.
When Cloudflare presents a Turnstile challenge, our system automatically detects and solves it using integrated CAPTCHA solving services. The challenge is resolved transparently without any code changes.
Cloudflare tracks mouse movements, keyboard timing, and scroll patterns. Our browsers simulate realistic human behavior with natural timing variations and movement patterns that pass behavioral analysis.
Cloudflare examines TLS handshakes to identify automated browsers. We use realistic TLS fingerprints that match real Chrome browsers to avoid detection at the network level.
Optional residential proxy integration allows you to route requests through residential IPs, avoiding Cloudflare's datacenter IP blocking. Support for rotating proxies and geo-targeting.
Common Use Cases
Browserless is built for automating systems you own or are authorized to access.
Start Bypassing Cloudflare Today
Run Puppeteer with automatic Cloudflare bypass. No complex setup, no maintenance. The free plan includes 1,000 units to get you started.