Access
agent()
Create a standard Browser-use agent.Configuration
Execute Options
Return Value
codeAgent()
Create an agent that generates and executes code.- More precise control over actions
- Complex data manipulation
- Custom logic during automation
Use Cases
Research Tasks
E-commerce Automation
Form Filling
Data Collection
Vision Capabilities
WhenuseVision: true, the agent can:
- Understand page layout visually
- Identify elements by their appearance
- Handle dynamic content better
- Work with canvas/image-based interfaces
Best Practices
Be specific about the task
Be specific about the task
Set appropriate maxSteps
Set appropriate maxSteps
Handle failures gracefully
Handle failures gracefully
Stagehand vs Browser-use
| Feature | Stagehand | Browser-use |
|---|---|---|
| Single actions | act() | - |
| Data extraction | extract() with schema | - |
| Multi-step tasks | agent() | agent() |
| Vision support | Limited | Full |
| Code generation | - | codeAgent() |
| Best for | Quick actions, extraction | Complex workflows |
- You need fast single actions
- You want structured data extraction
- Tasks are well-defined
- Tasks require many steps
- You need visual understanding
- Workflows span multiple sites

