- navigate(): Navigate to a specific URL.
- act(): Perform browser automation actions like clicking, typing, and navigation.
- extract(): Extract structured data from web pages using Zod schemas.
- observe(): Get a list of possible actions and elements on the current page.
Setup
- Install the required packages:
- Create a Stagehand Instance If you plan to run the browser locally, you’ll also need to install Playwright’s browser dependencies.
- Set up your model provider credentials:
Usage, Standalone, Local Browser
Usage with LangGraph Agents
Usage on Browserbase - remote headless browser
If you want to run the browser remotely, you can use the Browserbase platform. You need to set theBROWSERBASE_API_KEY
environment variable to your Browserbase API key.
BROWSERBASE_PROJECT_ID
to your Browserbase project ID.
BROWSERBASE
environment.