← AI GitHub

AI GitHub

Stagehand for code and model-assisted browser automation

Combine explicit browser steps with natural-language actions, extraction and observation.

AutomationPublished 2 min read

Key Takeaways

  • Stagehand exposes operations such as act, extract and observe alongside programmatic browser control.
  • Use a browser and the supported model configuration for the steps that require interpretation.
  • Automate a fixture with a changing label and an invariant element.
  • Natural-language actions can select the wrong plausible target.

How it works

Stagehand exposes operations such as act, extract and observe alongside programmatic browser control. Typed extraction provides a defined contract for data a page should return.

What you need

Use a browser and the supported model configuration for the steps that require interpretation. Put the invariant navigation and completion checks in ordinary code.

What to try first

Automate a fixture with a changing label and an invariant element. Use a model for the variable step and assert the final state in code.

Assert that extracted data matches a known fixture row. A typed response can satisfy the schema while naming the wrong person or product from the page.

Where to look for failures

Natural-language actions can select the wrong plausible target. Keep deterministic assertions and measure model calls separately from browser latency.

Related Franklin pages

Hold the browser task constant and compare the observation and action layers. An explicit selector, a structured browser snapshot and a model-chosen action fail in different ways.

For an agent interface that reaches mobile apps, see Franklin’s guide to Phone-Use. Phone-Use

Project documentation

Try it for your workflow

Explore the project’s documentation for setup and usage, or save this page to a collection for later.

Read the project documentation ↗