Stagehand
AI-powered web automation and structured data extraction SDK
Built on Playwright by Browserbase, Stagehand provides high-level `act()`, `extract()`, and `observe()` primitives for resilient web automation.
Kom hurtigt i gang
stagehand-demo.ts
Kom i gang med Stagehand i dit projekt.
import { Stagehand } from '@browserbasehq/stagehand'
import { z } from 'zod'
const stagehand = new Stagehand({ env: 'LOCAL' })
await stagehand.init()
await stagehand.page.goto('https://www.dsb.dk')
await stagehand.page.act('Click on Rejser and enter København H to Aarhus H')
const departures = await stagehand.page.extract({
instruction: 'Extract the earliest three train departure times and prices',
schema: z.object({ departures: z.array(z.string()) })
})
console.log(departures)
await stagehand.close()Om Stagehand
Stagehand is an open-source AI web automation framework built specifically for developers who need robust browser automations that do not break when CSS classes or DOM hierarchies change. Instead of brittle selectors, Stagehand uses natural language intent for actions and Zod schemas for structured extraction.
Danske data- og produkt-guides
Hvordan udviklere og agenter bruger Stagehand til at tilgå dansk digital infrastruktur.
Extract Real-time Danish Grocery Prices (Nemlig / Bilka)
Use `stagehand.extract()` with a Zod schema to extract organic milk prices, discounts, and delivery slots without brittle CSS selectors.
const prices = await stagehand.page.extract({
instruction: "Extract all organic milk items with their price in DKK and discount status",
schema: z.object({
items: z.array(z.object({ name: z.string(), priceDkk: z.number(), onSale: z.boolean() }))
})
})