The 4 tools at a glance
People searching for Playwright vs Stagehand, Browserbase or Firecrawl are usually building something with AI and a browser, and want to know which piece does what. They aren't four versions of the same thing:
| Tool | What it is | Needs an LLM? | Cost model |
|---|---|---|---|
| Playwright | Browser automation library + test runner | No | Free (Apache 2.0) |
| Stagehand | AI browser agent SDK (act, extract, observe) | Yes | Free SDK + LLM tokens |
| Browserbase | Cloud-hosted headless browsers | No | Paid usage |
| Firecrawl | Scrape, crawl, search and interact API for LLM-ready data | Optional | Credits (self-host option) |
Based on each project's documentation, November 2026.
What is Stagehand?
Stagehand is an open-source SDK from Browserbase for building browser agents, with SDKs for TypeScript, Python and Go. Instead of writing selectors, you call act("click the sign-in button"), extract() with a schema to pull structured data, or observe() to list possible actions, and an LLM works out the details. Since v3 (October 2025) it talks to Chrome directly over the Chrome DevTools Protocol and no longer depends on Playwright, though it keeps a Playwright-style API.
Playwright vs Stagehand
| Playwright | Stagehand | |
|---|---|---|
| How steps are defined | Code you write and review | Natural language, resolved by an LLM |
| Same result every run | Yes | Usually, helped by caching |
| Handles unfamiliar pages | No, you write the locators | Yes |
| Cost per run | $0 | LLM tokens per AI step |
| Browsers | Chromium, Firefox, WebKit | Chrome / Chromium |
| Test runner, reports, traces | Built in | Not a test framework |
| Best for | Regression tests, CI | Agents, data extraction, unknown sites |
Code side by side
await page.goto('https://www.saucedemo.com/'); await page.getByPlaceholder('Username').fill('standard_user'); await page.getByPlaceholder('Password').fill('secret_sauce'); await page.getByRole('button', { name: 'Login' }).click(); await expect(page.getByText('Products')).toBeVisible();
await stagehand.act('log in as standard_user with password secret_sauce'); const data = await stagehand.extract('the names and prices of all products', schema);
The Playwright version does exactly the same thing every time, for free, and fails loudly if the page changes. The Stagehand version adapts to page changes, at the cost of an LLM call per step and less certainty about exactly what happened. Check Stagehand's docs for the current API, which changes between major versions.
Playwright vs Browserbase
This one isn't a real contest. Browserbase is where browsers run, and Playwright is what drives them. You create a Browserbase session and connect Playwright to it:
const browser = await chromium.connectOverCDP(session.connectUrl);
That gives you hosted browsers with session replay and anti-bot features, which matter for agents and scraping. For a normal test suite, Playwright's own runner on your CI machines is usually enough and costs nothing extra.
Playwright vs Firecrawl
Firecrawl is an API that searches, scrapes and crawls websites and returns clean Markdown or structured JSON for LLMs, with an "interact" feature for clicks and forms. It handles rendering and crawling for you and bills in credits; it can also be self-hosted. Playwright does the same jobs if you write the code yourself, for free, with full control. Choose Firecrawl to feed many pages into an LLM quickly; choose Playwright for precise flows, logins and tests. Tutorial: Playwright web scraping.
When to use each
- Regression tests and CI gates: Playwright.
- An AI agent working on sites you don't control: Stagehand (or Browser Use, see Browser Use vs Playwright).
- Hosted browsers at scale, stealth or session replay: Browserbase, driven by Playwright or Stagehand.
- Turning websites into LLM-ready data: Firecrawl.
- Writing tests faster with AI: Playwright plus Claude and the Playwright MCP Server. The AI writes the test once; CI runs it for free forever.
Want the best of both? The AI Playwright plan teaches Playwright first, then how to have Claude write your tests through the MCP Server.
Frequently Asked Questions
What is the difference between Playwright and Stagehand?
Playwright is a deterministic browser automation library and test framework: you write every step and assertion in code. Stagehand, from Browserbase, is an SDK for AI browser agents with act, extract and observe methods that use an LLM to turn natural-language instructions into browser actions. Playwright suits regression tests; Stagehand suits agents working on unfamiliar pages.
Is Stagehand built on Playwright?
Not any more. Stagehand v3, released in October 2025, removed the Playwright dependency and drives Chrome directly over the Chrome DevTools Protocol. It keeps a Playwright-style API, and Browserbase says it can still be used alongside Playwright and Puppeteer.
Is Browserbase an alternative to Playwright?
No. Browserbase hosts headless browsers in the cloud. You connect Playwright to a Browserbase session with chromium.connectOverCDP, so it is where your Playwright scripts run, not a replacement for them.
Is Firecrawl better than Playwright for web scraping?
For turning many pages into clean Markdown or JSON quickly, Firecrawl is easier because it handles crawling and rendering for you, billed in credits. Playwright gives you full control at no cost, which is better for complex logins, precise interactions, or when you also need tests.
Does Stagehand cost money?
Stagehand needs an LLM, so each AI step costs tokens from your model provider. Running on Browserbase's cloud adds its own charges. Playwright itself is free and needs no LLM to run tests.
Can I use Stagehand for testing?
You can, but most teams keep CI regression tests in Playwright, because LLM-driven steps can vary between runs and cost tokens each time. Stagehand's caching reduces this, but deterministic tests are still the safer choice for a pass/fail gate.
Playwright + Claude AI Course
Get AI Speed Without Paying an LLM on Every Test Run.
This course teaches Playwright in JavaScript from scratch, then shows you how to use Claude AI with the Playwright MCP Server to explore your app and write real, reviewable test files. You pay for AI once, while writing, instead of on every CI run. Rated 4.5★ from 130+ ratings, 510+ students.
- Playwright from first test to GitHub Actions CI
- Claude AI + Playwright MCP Server test generation
- Deterministic tests that give the same result every run
- API testing and the Page Object Model