Skip to main content
Not sure which browser automation approach to use? This guide will help you make the right choice.

Quick Decision Tree

1

Is it a simple 1-2 action task?

Yes → Use Browser ActionsNo → Continue to next step
2

Is the primary goal data extraction?

Yes → Use Browser CodeNo → Continue to next step
3

Does it require multi-step navigation or complex workflow?

Yes → Use Browser AgentsNo → Use Browser Actions

By Use Case

Simple Interactions

Example: “Click the login button and enter email”

Browser Actions

Best Choice - Fast, cheap, and perfect for simple tasks
Why?
  • Completes in 1-2 steps
  • Cacheable for cost savings
  • Fast execution
  • Predictable outcome

Data Extraction

Example: “Extract all product names and prices from the page”

Browser Code

Best Choice - Precise, reliable extraction with structured output
Why?
  • Returns structured data
  • Precise control over extraction logic
  • Cacheable code generation
  • Reliable and repeatable
Alternative: Use browser_assess_page for simpler extraction with schema validation.

Multi-Page Workflows

Example: “Complete the checkout process from cart to confirmation”

Browser Agents

Best Choice - Autonomous navigation with unlimited steps
Why?
  • No step limit
  • Handles complex flows
  • State management
  • Adaptive to page changes

Visual Understanding

Example: “Find and click the green ‘Confirm’ button in the modal”

Computer Use Agent

Best Choice - Vision-based understanding of layout
Why?
  • Understands visual layout
  • Extended reasoning capability
  • Works with complex visual interfaces
  • Can identify elements by appearance

Comparison Matrix

By Task Complexity

Complexity LevelTask ExamplesBest ChoiceAlternative
Low
(1-2 steps)
• Click button
• Fill single field
• Navigate to page
Browser Actions-
Medium
(3-10 steps)
• Multi-step form
• Login flow
• Search and filter
Browser AgentsBrowser Actions (if predictable)
High
(10+ steps)
• Complete checkout
• Multi-page wizard
• Complex workflow
Browser Agents-
Data Focused• Extract table data
• Scrape listings
• Parse structured info
Browser Codebrowser_assess_page

By Priority

PriorityRecommendationWhy
Cost OptimizationBrowser Actions (with caching)5 credits per cached execution
ReliabilityBrowser CodeExplicit, deterministic logic
FlexibilityBrowser AgentsHandles unpredictable scenarios
SpeedBrowser ActionsFast execution, minimal overhead
PrecisionBrowser CodeExact control over operations

By Output Needs

What You NeedBest ChoiceExample
No output (just actions)Browser Actions or AgentsClick, navigate, type
Simple confirmationBrowser Actions”Button clicked successfully”
Structured dataBrowser Code[{name: "...", price: "..."}]
Page assessmentbrowser_assess_pageEvaluated structured data
ScreenshotsAny + browser_get_screenshotPNG image data

Common Scenarios

Task: Search for “wireless headphones”, filter by price under $100, and add first result to cart
{
  "type": "browser_action",
  "action": "Search for 'wireless headphones' and click the first result under $100"
}
// ⚠️ Might hit 2-step limit
Verdict: Use Browser Agents - requires multiple steps (search, filter, select, add to cart)

Scenario 2: Extract Product Listings

Task: Extract all products with name, price, and rating from the current page
{
  "type": "execute_javascript",
  "prompt": "Extract all products with name, price, and rating as array of objects",
  "return_by_value": true
}
// ✅ Precise, structured output
Verdict: Use Browser Code for complex extraction or browser_assess_page for simpler needs

Scenario 3: Login and Navigate

Task: Log in to dashboard and navigate to settings page
{
  "type": "browser_action",
  "action": "Click login button and navigate to settings"
}
// ⚠️ Only if login is 1 click
Verdict: Use Browser Agents - login flows often require multiple steps

Scenario 4: Click Submit Button

Task: Scroll to the bottom and click the submit button
{
  "type": "browser_action",
  "action": "Scroll to bottom and click submit button"
}
// ✅ Perfect fit - 2 simple actions
Verdict: Use Browser Actions - simple, predictable, cacheable

Cost Considerations

Optimize for Cost

  1. Use Browser Actions for repeated simple tasks
    • Fresh: 50 credits
    • Cached: 5 credits (10x cheaper!)
  2. Cache Browser Code for repeated extractions
    • Code generation cached
    • Subsequent runs cheaper
  3. Avoid over-using Agents for simple tasks
    • Variable cost based on steps
    • More expensive than Actions

Example Cost Comparison

Task: Click login button (repeated 100 times)
ApproachCost
Browser Actions (cached)5 credits × 100 = 500 credits
Browser Actions (fresh)50 credits × 100 = 5,000 credits
Browser Agents~2-5 steps × cost/step × 100 = Higher
For repeated tasks, Browser Actions with caching provides massive cost savings!

Still Not Sure?

Start Simple, Upgrade as Needed

  1. Try Browser Actions first if the task seems simple
  2. Upgrade to Agents if you hit the 2-step limit
  3. Switch to Code if you need precise data extraction

Ask Yourself

  • 1-2 steps: Browser Actions
  • 3+ steps: Browser Agents
  • Just extraction: Browser Code
  • Yes, frequently: Browser Actions (for caching)
  • No, one-time: Any approach works
  • Varies by data: Browser Code (caches generation)
  • Very predictable: Browser Actions or Code
  • Some variation: Browser Agents
  • Highly dynamic: Browser Agents
  • None (just actions): Browser Actions
  • Structured data: Browser Code
  • Completion confirmation: Browser Agents

Quick Reference

Need Help?

For detailed implementation, see individual guides or contact support at [email protected].