What is Stagehand?
Stagehand is a browser automation framework used to control web browsers with natural language and code. By combining the power of AI with the precision of code, Stagehand makes web automation flexible, maintainable, and actually reliable.Quickstart Guide
Get started with Stagehand in minutes
Installation
Detailed installation instructions
API Reference
Explore the complete API documentation
Examples
View real-world automation examples
Why Stagehand?
Most existing browser automation tools either require you to write low-level code in a framework like Selenium, Playwright, or Puppeteer, or use high-level agents that can be unpredictable in production. By letting developers choose what to write in code vs. natural language (and bridging the gap between the two) Stagehand is the natural choice for browser automations in production.Flexible Control
Choose when to write code vs. natural language: use AI when you want to navigate unfamiliar pages, and use code when you know exactly what you want to do.
AI-Driven to Repeatable
Preview AI actions before running them, and easily cache repeatable actions to save time and tokens.
Write Once, Run Forever
Auto-caching combined with self-healing remembers previous actions, runs without LLM inference, and knows when to involve AI whenever the website changes.
Key Features
Natural Language Actions
Useact() to execute browser actions with simple commands:
Structured Data Extraction
Extract data from web pages with type-safe schemas:Multi-Step Agents
Create agents that can execute complex, multi-step tasks:Browser Control
Access Stagehand’s optimized CDP engine for low-level browser control:Example Automation
Here’s a complete example that navigates to GitHub, clicks on a repository, and extracts PR information:Core Methods
Stagehand provides four core methods for browser automation:act()
Execute individual browser actions with natural language
extract()
Extract structured data from web pages with type-safe schemas
observe()
Identify possible actions on a page without executing them
agent()
Create autonomous agents for multi-step automation tasks
Browser Environments
Stagehand supports multiple browser environments:- BROWSERBASE - Cloud-based browser infrastructure (recommended for production)
- LOCAL - Run on your local machine for development
- Compatible with Playwright, Puppeteer, and Patchright
Next Steps
Get Started
Follow the Quickstart Guide to create your first automation in minutes
Install Stagehand
See Installation for detailed setup instructions
Learn Core Concepts
Understand how Stagehand works under the hood
Explore Examples
Browse real-world examples to learn best practices
Need help? Join our Discord community or check out the GitHub repository for support.