The Stagehand page
The active page is whichever tab Chrome has focused in its last-focused window, so a tab the browser opens and activates becomes the target on its own.act(), observe(), and extract() all default to that page.
The usual patterns keep working:
- TypeScript
- Python
- Go
Manual page management
For more control or multitab workflows, you can manage multiple tabs explicitly. Set the active page when you want the default target to follow you:- TypeScript
- Python
- Go
Locators belong to the page they were created on.
page.locator(selector) carries that page’s identity, so a locator from one tab never resolves against another.Next steps
Act
Target a specific tab with the
page option on any primitive.Working with iframes
Stagehand traverses iframes automatically. Scope with a selector when you need to narrow the snapshot.
Browser configuration
Manage browser contexts and sessions for complex automation scenarios.
Logging & debugging
Set log levels and read structured records while you debug.

