CloakBrowser Hands-On: Bypass Cloudflare Turnstile in 30 Seconds
From pip install to your first Cloudflare Turnstile PASS — 3 lines of code, drop-in Playwright replacement, and proxy integration.
Install
One command:
pip install cloakbrowser
On first launch, CloakBrowser auto-downloads the custom Chromium binary (~200MB, cached for subsequent runs).
For auto-detecting timezone and locale from your proxy IP:
pip install cloakbrowser[geoip]
Verify Installation
python -m cloakbrowser info
Expected output:
Version: 146.0.7680.177.5
Platform: linux-x64
Installed: True
Path: /home/user/.cloakbrowser/chromium-146.0.7680.177.5/chrome
Force download if needed:
python -m cloakbrowser install
Docker Quick Test
docker run --rm cloakhq/cloakbrowser cloaktest
3 Lines to Replace Playwright
Migrating from existing Playwright code:
- from playwright.sync_api import sync_playwright
- pw = sync_playwright().start()
- browser = pw.chromium.launch()
+ from cloakbrowser import launch
+ browser = launch()
page = browser.new_page()
page.goto("https://example.com")
# ... rest of your code unchanged
launch() returns a standard Playwright Browser object. All standard APIs work.
With a Proxy
from cloakbrowser import launch
browser = launch(
proxy="http://user:pass@proxy.16yun.cn:8888",
geoip=True, # match timezone/locale to proxy IP
headless=False,
humanize=True, # human-like behavior
)
page = browser.new_page()
page.goto("https://example.com")
The proxy URL format follows the same convention as 16Yun's Crawler Proxy documentation: http://username:password@host:port.
Headless Considerations
Even with C++-level patches, some detection services run extra checks against headless mode:
- General scraping:
headless=Trueworks for most sites - Cloudflare Turnstile or reCAPTCHA v3 Enterprise: Use
headless=False - Maximum stealth:
headless=False+humanize=True
Verify Turnstile PASS
Use the built-in test:
docker run --rm cloakhq/cloakbrowser cloaktest
Or in code:
from cloakbrowser import launch
browser = launch(headless=False)
page = browser.new_page()
page.goto("https://example.com")
page.wait_for_timeout(3000)
status = page.text_content(".challenge-result")
print(f"Turnstile: {status}") # Expected: PASS
browser.close()
Published test results (CloakBrowser Chromium 146):
| Detection Service | Result | Notes |
|---|---|---|
| Cloudflare Turnstile (non-interactive) | ✅ PASS | Auto-resolve |
| Cloudflare Turnstile (managed) | ✅ PASS | Single click |
| reCAPTCHA v3 | 0.9 score | Server-verified human |
| BrowserScan | ✅ Normal (4/4) | All checks pass |
| FingerprintJS | ✅ Not flagged | demo.fingerprint.com |
Boost Success Rate with 16Yun Proxies
CloakBrowser solves "who you are"; proxies solve "where you are." Together they achieve the highest pass rate.
from cloakbrowser import launch
browser = launch(
proxy="http://user:pass@proxy.16yun.cn:8888",
geoip=True, # auto-set timezone/locale from proxy IP
headless=False,
humanize=True,
)
page = browser.new_page()
page.goto("https://httpbin.org/ip")
print(page.text_content("body")) # Confirm IP changed
geoip=True aligns the browser's timezone and locale with the proxy IP's geographic location. This eliminates an important fingerprint inconsistency — an exit IP in Tokyo shouldn't show Beijing time.
Recommended Configurations by Product
| Proxy Product | Best For | CloakBrowser Setup |
|---|---|---|
| Crawler Proxy (tunnel) | Large-scale page collection | proxy=http://user:pass@host:port, use Connection: Close for IP rotation |
| API Proxy | Custom extraction strategy | Extract IPs via API first, then pass dynamically to proxy param |
| Dedicated Proxy | Long sessions, fixed exit | proxy=http://user:pass@host:port + launch_persistent_context() |
Troubleshooting
Binary not found
python -m cloakbrowser install
Proxy configured but IP unchanged
Verify the proxy URL format with curl:
curl -x http://user:pass@proxy.16yun.cn:8888 http://httpbin.org/ip
If curl returns the proxy's exit IP but CloakBrowser doesn't, check that the proxy parameter is passed to launch().
Turnstile still blocking
- Disable headless mode
- Enable
humanize=True - Ensure you're using residential IPs, not datacenter IPs
- The target may use managed Turnstile (click required) — humanize handles this
407 Proxy Authentication Required
This means proxy authentication failed. Per 16Yun's help documentation:
- Verify domain, port, username, and password are correct
- Confirm the proxy auth is properly configured in your code
- Test with the minimal example code first
Need an enterprise proxy plan?
We can tailor architecture to your target domains, concurrency, and reliability goals.