The three decorators
A decorator is just a tag you put above a Python function to change how it runs. Botasaurus gives you three, each matching a different way of fetching data:
@browser— runs your function inside a real automated Chromium browser, with consistent browser configuration and human-like behaviour already applied. Use it when the page needs a full browser to load.@request— runs your function as a plain HTTP request (faster, no browser) with browser-consistent headers. Use it when the page works without JavaScript.@task— a general wrapper for work that is not scraping at all (parsing, API calls, machine-learning steps), so that work can still use Botasaurus's parallelism and caching.
You can mix all three in one project: @request grabs a listing page from an XHR endpoint, @browser opens detail pages that need JavaScript, and @task runs the LLM extraction step.
How the mouse physics work
Behavioural anti-bot systems such as DataDome observe a wide range of interaction signals — the path a mouse takes, scroll speed, typing rhythm, click location — and score them in real time. Default automation that moves the cursor with page.mouse.move(x, y) produces a perfectly straight path, a pattern unlike anything a human hand creates. This is one of the simplest behavioural signals such systems use.
Botasaurus ships Humancursor, a separate library by Flori Batusha and Ambri, that draws Bezier-curve paths (smooth curves rather than straight lines) with randomised speed and Fitts's Law deceleration — meaning the cursor slows as it nears the target, slightly overshoots, then corrects, just like a person. The page.click_human(selector) helper exposes this through a single call. The library exists because realistic input simulation is a recurring requirement in legitimate UI testing and automation, not only in scraping.
What Botasaurus does not replace
Botasaurus is a framework, not a complete stack on its own. A production setup typically also involves:
- Residential or mobile proxies for a stable IP — datacenter IPs are often blocked at the network layer regardless of behaviour.
- A patched browser binary (CloakBrowser / Camoufox) on sites that inspect things like Function.toString() output or run Akamai's 60-extension probe. Botasaurus operates at the JavaScript layer on top of a stock Chromium.
- curl_cffi or tls-client for HTTP-only work where a browser-consistent TLS handshake matters. Botasaurus's
@requestuses browser-like defaults but does not reproduce a curl_cffi-grade JA4 TLS fingerprint.
In a production setup, Botasaurus is the orchestration and behaviour layer; you pair it with the right network and browser-binary layers underneath for content you are permitted to access.
