How to Scrape Structured Data with Stagehand Extract
Selector-based scrapers break on every redesign. Stagehand's extract() turns a page into typed JSON from a schema. Here is how to build a resilient scraper…
A browser automation SDK built for AI agents, not brittle selectors
Stagehand is an open-source SDK that lets AI agents drive a real browser using plain-language actions, then drop into Playwright code wherever you want exact control.
Stagehand is built by Browserbase, the team selling cloud browsers for agents. It sits on top of Playwright and adds three verbs: act for a single step, extract for pulling structured data, and observe for finding what is clickable. Instead of hardcoding a CSS selector that breaks next Tuesday, you write “click the Sign in button”.
The smart part is the escape hatch. You can mix AI steps and hand-written Playwright calls in the same script, so you use AI only where the page is messy.
page.act("fill the email field") without selectors.If you have ever maintained a Puppeteer script that dies every time a site redesigns, Stagehand is aimed at you. Caching is what makes it practical — you explore with AI, then replay the cached plan cheaply in production.
Caveat: it still hits real LLM calls during exploration, so costs and latency add up on long flows. And it is not a no-code tool; you need to write TypeScript.
Good for developers building scraping, QA or RPA flows against changing UIs. Not for teams wanting a drag-and-drop automation builder like Make.
The SDK is free and open-source (MIT). You pay for the LLM tokens it uses and, optionally, Browserbase’s cloud browser minutes. Free browser hours exist on Browserbase’s entry plan; check the site for current caps.