Browser automation for agents means driving a real browser (click, type, read the page) from code or from an LLM. The tool you pick on top of the browser is rarely the bottleneck; the browser’s fingerprint and where its state lives are. Related notes: Data Extraction, AI Agents, MCP, Testing.

Choosing a browser

OptionKindUse it forLimit
PlaywrightLibrary (Chromium, Firefox, WebKit)Deterministic flows on sites without strict bot protection; storage_state keeps a loginStock Chromium is fingerprinted and blocked by strict WAFs
PatchrightPatched PlaywrightStealth with the same APIStill Chromium: tested blocked on an Akamai-protected shop
CamoufoxFirefox anti-detect buildStrict anti-bot sites; persistent profile on diskFirefox: no CDP, use the Playwright API
Lightpanda / ObscuraLight headless enginesFast public reads, no ChromiumObscura opens a new context per CDP connection, so no state survives between processes
chrome-devtools-mcpMCP over Chrome (Puppeteer)Debugging, network and performance traces, attaching to a running ChromeNeeds a Chrome to attach to
Browser-useLLM agent layerOpen-ended goals on unfamiliar sitesLLM cost per task, still blocked by WAFs
Browserbase, Steel, KernelHosted browser infrastructureAnti-bot at scale, session Contexts/ProfilesPaid and external
agent-browserCLI browserPersistent profiles, reuse of a Chrome profile

What decides it

  1. Fingerprint, not IP. A strict WAF checks TLS and JS fingerprints. On one retail site stock Chromium and Patchright were blocked, while Camoufox and Obscura passed. Test the real target before choosing.
  2. State must outlive the process. A logged-in session or cart needs a persistent profile directory (cookies, localStorage, IndexedDB). The whole industry converges on this: Browserbase Contexts, Steel and Kernel Profiles, Browser-use persist_profile, agent-browser --profile, Playwright storage_state or a persistent context.
  3. Keep the browser alive for polling. A fresh browser per poll is slow; one persistent page removes start-up cost.
  4. Do not bypass what a site forbids. Read-only work and carts prepared for a human fit; logins go through a vault or the person, and paying is always human.

Camoufox pattern

from camoufox.sync_api import Camoufox
 
with Camoufox(headless=True, locale="es-ES", humanize=True,
              persistent_context=True, user_data_dir="profile-dir") as ctx:
    page = ctx.pages[0] if ctx.pages else ctx.new_page()
    page.goto("https://example.com", wait_until="domcontentloaded")

Use one profile directory per site or project so sessions never mix. Pass i_know_what_im_doing=True to silence the canvas warning once you accept it.