Skip to content
Guide

Botasaurus Not Working on Cloudflare or Turnstile in 2026: Errors and Fixes

NSLSolver TeamPublished Updated 8 min read

Botasaurus usually fails on Cloudflare for one of four reasons: it runs with headless=True (its own README says Cloudflare will identify headless mode), it runs headful Chrome on a Linux server without a display, the botasaurus and botasaurus-driver packages are out of sync, or the IP is a datacenter address. Fix them in that order and use driver.google_get(url, bypass_cloudflare=True); if a Turnstile or managed challenge still loops, move only the challenge step to a solver API.

Below are the errors people actually report on the Botasaurus issue tracker, what each one means, the fixes inside Botasaurus itself, and an honest look at when to stop scaling browsers. API names were checked against the README and PyPI on 2026-12-01.

Quick answer: what your Botasaurus error means

Find the message or symptom you are seeing. Most of them trace back to the environment Chrome runs in, not to your scraping code.

TimeoutError: Response not received
google_get(..., bypass_cloudflare=True) gave up waiting. Reported in issue #194. Usually Chrome did not start cleanly or the challenge never cleared. Upgrade every Botasaurus package, run the README's minimal example headful, then retry with max_retry.
Stuck on "Just a moment..." or "Verify you are human" with headless=True
Headless Chrome was detected. The README warns that headless mode will surely be identified by Cloudflare and Datadome. Remove headless=True and any --headless=new argument.
Works on Windows or macOS, fails on an Ubuntu server
The server environment, not your code. Issues #147 and #282 describe exactly this. Run headful under Xvfb with @browser(enable_xvfb_virtual_display=True) and use a residential IP.
TypeError: Driver.__init__() got an unexpected keyword argument 'enable_xvfb_virtual_display'
botasaurus and botasaurus-driver do not match. Seen in issue #253 on botasaurus 4.0.87. Upgrade all Botasaurus packages together with the README's pip command.
@request returns 403 on a challenge page
The request module cannot run JavaScript. The README says so explicitly. Use @browser with google_get(..., bypass_cloudflare=True) for JavaScript challenges.
detect_and_bypass_cloudflare() does nothing or never returns
The widget is hard to reach, or the call hangs. Issue #160 covers widgets inside a shadow DOM; open issue #305 (July 2026) reports a timeout inside the driver's select() during the bypass. Wrap it in your own retry budget.
Challenge passes, then the next pages are blocked
Bot-like pacing or a changing IP. Enable human mode, add random sleeps, keep the same driver and proxy, and fetch follow-up pages with driver.requests.get.
Blocked as soon as an authenticated proxy is added
The proxy plumbing gives you away. The README warns that authenticated proxies wired through selenium-wire get identified. Pass the proxy to @browser(proxy=...) instead.
Coming from Selenium or undetected-chromedriver? Compare with undetected-chromedriver not working in 2026 →

What bypass_cloudflare=True actually covers

The Botasaurus README splits Cloudflare into two cases. The connection challenge only needs a browser-like connection with the right headers: visiting through a Google referrer with driver.google_get is enough, and the @request module also works if you allow retries. The JS with Captcha challenge runs JavaScript checks that tell an automated Chrome from a real one and may include a CAPTCHA. For that one the README says to pass bypass_cloudflare=True to google_get, and that @request does not work because it cannot run JavaScript.

The driver also exposes detect_and_bypass_cloudflare() and accepts bypass_cloudflare=True on driver.get. Botasaurus deliberately does not change browser fingerprints by default; the README explains that a spoofed user agent can be caught by tests that compare it with the real browser. That choice works well on a desktop with a real GPU and a normal home connection, and it is exactly why results differ so much on a bare server.

Why Botasaurus fails on Cloudflare: the root causes

  • Headless mode. The README's own warning: with headless=True you will surely be identified by services like Cloudflare and Datadome, so use it only on sites without them.
  • A server environment. Reporters in issues #147 and #282 see the same code pass on Windows and fail on Ubuntu, in #147 even from the same IP. Headful Chrome on Linux needs a virtual display, and a machine with no GPU looks different to passive browser checks.
  • Network reputation. The README's "Why am I getting detected" section lists non-residential proxies first: Cloudflare and Datadome often flag datacenter IPs and VPNs.
  • Behaviour. The same section lists clicking without human mode and visiting pages too quickly.
  • Package drift. Botasaurus is split across several packages (botasaurus, botasaurus-driver, botasaurus-requests and more). When one lags behind you get errors such as unexpected keyword arguments, and the maintainer's standard reply in issues #137 and #147 is to upgrade all of them.

Fix 1: upgrade every Botasaurus package together

Start here, because it is the maintainer's first answer on Cloudflare issues. Upgrade the whole family in one command, then confirm that botasaurus and botasaurus-driver both moved. On PyPI the latest releases are botasaurus 4.0.97 (January 2026) and botasaurus-driver 4.0.101 (August 2026).

upgrade.sh
# Upgrade the whole Botasaurus family in one go (command from the README)
python -m pip install --upgrade bota botasaurus botasaurus-api botasaurus-requests \
  botasaurus-driver botasaurus-proxy-authentication botasaurus-server botasaurus-humancursor

# Both should be current (PyPI, 2026-12-01: botasaurus 4.0.97, botasaurus-driver 4.0.101)
python -m pip show botasaurus botasaurus-driver | grep -E "Name|Version"

Fix 2: run headful and use google_get with bypass_cloudflare

Remove headless=True and any --headless=new passed through add_arguments. Use google_get rather than get so the visit arrives with a Google referrer, as the README recommends, and pass bypass_cloudflare=True only for sites that really show the challenge.

While debugging, add driver.prompt() after the call: it pauses so you can see what the browser sees. If the challenge still loops in a visible browser on your own desktop, the cause is the site's configuration or your IP, not your server setup, and no Linux tweak will change that.

fetch.py
from botasaurus.browser import browser, Driver

@browser(
    # headless=True,  # remove it: the README says Cloudflare will identify headless mode
    max_retry=5,
    output=None,
)
def fetch(driver: Driver, link):
    # Google referrer + Cloudflare handling, as shown in the README
    driver.google_get(link, bypass_cloudflare=True)
    # driver.prompt()  # uncomment while debugging to pause and look at the browser
    return driver.page_html

fetch("https://target-site.com/")

Fix 3: Linux servers and Docker

On a VM, the README says a headful browser needs a virtual display and gives the switch: enable_xvfb_virtual_display=True. Combine it with a residential proxy and a persistent tiny profile so cookies survive between runs. For containers, the README points to the botasaurus-starter template, which ships a Dockerfile and docker-compose configuration; start from it rather than writing your own image.

Two more checks from the issue tracker: one Ubuntu user in #147 also passes add_arguments=['--no-sandbox'], and in #141 the maintainer suggests reproducing in the Gitpod starter to rule out the local machine. If the same script passes there and fails on your server, the difference is the environment or the IP.

fetch_linux.py
from botasaurus.browser import browser, Driver

@browser(
    enable_xvfb_virtual_display=True,          # headful Chrome on a server with no screen
    proxy="http://username:password@residential-proxy:port",
    remove_default_browser_check_argument=True,
    tiny_profile=True,
    profile="worker-1",                        # keeps cookies between runs
)
def fetch(driver: Driver, link):
    driver.google_get(link, bypass_cloudflare=True)
    driver.short_random_sleep()
    return driver.page_html

Fix 4: proxies, pacing and human mode

  • Use a residential proxy and pass it as @browser(proxy=...). Authenticated proxies are supported, and a list of proxies rotates automatically.
  • Call driver.enable_human_mode() before clicking, and slow down with driver.short_random_sleep() or driver.long_random_sleep().
  • Navigate like a person: google_get or get_via_this_page instead of a burst of driver.get calls.
  • Set remove_default_browser_check_argument=True; the README says the --no-default-browser-check flag is detectable by systems like Datadome.
  • Clear the challenge once, then fetch follow-up pages through the same browser session with driver.requests.get, as the README's production template does.
scrape.py
from botasaurus.browser import browser, Driver

@browser(reuse_driver=True, max_retry=5, output=None)
def scrape(driver: Driver, link):
    if driver.config.is_new:                  # first task in this browser
        driver.enable_human_mode()
        driver.google_get(link, bypass_cloudflare=True)
    response = driver.requests.get(link)      # follow-up fetches reuse the cleared session
    response.raise_for_status()
    return response.text

When to stop scaling browsers

Botasaurus is a good tool when you need a real browser for navigation and extraction. Where it hurts is the challenge itself at scale: every worker is a full Chrome, every server needs a display and a clean IP, and when Cloudflare loops on a Linux box there is little left to tune except the environment. If the loop shows up on more than a handful of targets, or you are adding servers just to keep Chrome alive, move only the challenge step out of the browser.

A managed solver API returns the cf_clearance cookie and the User-Agent it belongs to, and your code fetches pages with a light HTTP client through the same proxy. The clearance is tied to the User-Agent and fingerprint the solver returns, so replay it with a client that matches them, not inside Botasaurus's desktop Chrome, whose User-Agent and fingerprint differ.

Example: NSLSolver for the challenge, a light client for the pages

Send the target url, the challenge site_key and your proxy to NSLSolver's challenge type. The response contains cookies (with cf_clearance) and a user_agent. The clearance is issued for an iPhone Safari browser, so replay it with that user_agent through the same proxy, using a client with a matching fingerprint; here that is curl_cffi with impersonate="safari_ios".

Challenge solves average about 3.3 seconds and cost $1.00 per 1,000, only successful solves are billed, and sign-ups with Google, Gmail or Proton get free credit. NSLSolver covers Cloudflare Turnstile and Challenge, reCAPTCHA v3, Kasada and Akamai (beta); it does not solve DataDome, hCaptcha, reCAPTCHA v2 or image CAPTCHAs. Only automate sites you own or are authorised to access.

nslsolver_challenge.py
import curl_cffi

TARGET = "https://target-site.com/"
PROXY = "http://user:pass@host:port"     # the proxy you will fetch pages through

data = curl_cffi.post(
    "https://api.nslsolver.com/solve",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "type": "challenge",
        "url": TARGET,
        "site_key": "0x4AAAAAAA...",     # the challenge widget id
        "proxy": PROXY,                  # required for challenge
    },
    timeout=120,
).json()

# The clearance is issued for an iPhone Safari browser, so replay it with the
# returned user_agent, an iOS Safari fingerprint and the same proxy.
s = curl_cffi.Session(impersonate="safari_ios")
s.headers["User-Agent"] = data["user_agent"]
s.cookies.update(data["cookies"])        # includes cf_clearance

html = s.get(TARGET, proxy=PROXY).text

Full /solve API reference

Related guides

Frequently asked questions

Why is Botasaurus bypass_cloudflare=True not working?

Most often because of headless mode, a Linux server without a virtual display, mismatched Botasaurus packages or a datacenter IP. Remove headless=True, enable_xvfb_virtual_display=True on servers, upgrade all Botasaurus packages together and use a residential proxy. If it still loops in a visible browser on a desktop, the site's challenge is stronger than the browser approach.

Does Botasaurus work in headless mode on Cloudflare sites?

Not reliably. The Botasaurus README itself says that in headless mode you will surely be identified by services like Cloudflare and Datadome, and recommends headless only for sites that do not use them.

How do I run Botasaurus on a Linux server or in Docker?

Run Chrome headful under a virtual display with @browser(enable_xvfb_virtual_display=True), and for Docker start from the botasaurus-starter template, which includes a Dockerfile and docker-compose setup. Pair it with a residential proxy, since server IPs are flagged far more often.

What does "TimeoutError: Response not received" mean in Botasaurus?

The driver waited for a page response that never arrived, typically during google_get with bypass_cloudflare=True (issue #194). Check that Chrome starts with the README's minimal example, upgrade every Botasaurus package, then retry with max_retry. If it only happens on challenged sites, the challenge is not clearing in your environment.

Can Botasaurus solve Cloudflare Turnstile?

The README demos bypass_cloudflare=True and a human-mode checkbox click on a Turnstile demo page, so it can on a normal desktop. Results depend on the environment: issue #282 reports invisible Turnstile passing on Windows but not on Linux.

Can I use NSLSolver together with Botasaurus?

Yes, for the challenge step. NSLSolver returns cf_clearance and its User-Agent for a Cloudflare challenge, which you replay through the same proxy with a matching HTTP client, or a token for a Turnstile widget (type turnstile, site_key and url) that you submit as cf-turnstile-response. Keep Botasaurus for sites that need a full browser for other reasons.

Stop running Chrome just to pass Cloudflare

Keep Botasaurus for the pages that need a browser and let NSLSolver return cf_clearance with one POST. Free credit with Google, Gmail or Proton sign-up, no card needed.