Skip to content
Agents tracked: 258 Downloads (7d): 219M up 6.1% GitHub stars: 5.5M VS Code installs: 148M Releases (7d): 293 Agent pull requests (last week): 937K Updated Oct 7, 2026
Recipe

Automate a web task in natural language with Stagehand

Stagehand's starter project scripts a browser with plain-English instructions. act, extract and observe handle single steps, and agent runs a multi-step task on its own.

The problem

Hand-written Playwright or Selenium selectors break when a site changes its layout. Describing each step in natural language makes scrapers and form-fillers less fragile.

Steps

  1. Scaffold a project with npx create-browser-app.
  2. cd into the new folder and copy .env.example to .env.
  3. Add a model provider key, such as OPENAI_API_KEY, and BROWSERBASE_API_KEY if you want cloud browsers.
  4. Edit the script to use act for clicks, extract for structured data and observe to list what's on the page.
  5. Run it with npm start.

From the official docs

await stagehand.act("Click the 'Evals' button.");
const extractResult = await stagehand.extract("Extract the value proposition from the page.");
const observeResult = await stagehand.observe("What can I click on this page?");

Results

  • A TypeScript script that clicks, extracts and inspects pages from short instructions.
  • agent.execute runs multi-step goals with a computer-use model.
  • The same script runs on a local browser or on Browserbase cloud browsers.

As reported by the source (Stagehand docs); AgentGid did not measure these figures.

Takeaway. Use act and extract for steps you know in advance, and save the autonomous agent for open-ended goals.
AgentGid's take

This suits a developer comfortable with TypeScript and Node who wants sturdier scrapers or form-fillers, and who can supply a model API key. Model usage is billed separately from the free MIT library, so costs scale with how many pages and agent runs you do, and Browserbase cloud browsers are only needed if you skip local ones. Browser Use (Free) ranks one place higher and is also open source.

The agent used here

Similar use cases