Skip to main content
Browser commands enable you to automate web browser interactions including opening pages, clicking elements, filling forms, and extracting content. These commands are essential for web scraping and browser-based automation workflows.

Overview

Browser commands provide functionality for:
  • Opening and navigating web pages
  • Interacting with DOM elements (clicks, inputs, scrolling)
  • Extracting text content and attributes
  • Managing browser sessions
  • Handling dynamic content and JavaScript-rendered pages

Available Commands

Common Use Cases

  • Web Scraping: Extract content from web pages
  • Form Automation: Automate form filling and submission
  • Dynamic Content: Handle JavaScript-rendered content
  • Multi-Page Navigation: Navigate through multiple pages
  • Content Extraction: Extract text, links, and attributes from pages

Session Management

Browser commands support session management for maintaining state across commands:
{
  "command": "browser-open",
  "params": {
    "sessionId": "#{UUID}",
    "url": "https://example.com"
  }
}

Command Parameters

Browser commands typically support the following parameters:
ParameterTypeDescriptionRequired
sessionIdstringSession identifier for maintaining stateNo
urlstringURL to navigate toYes (for browser-open)
selectorstringCSS selector for element targetingYes (for interaction commands)
timeoutnumberMaximum wait time in millisecondsNo
elementsLocatorobjectElement locator configurationYes (for extraction commands)

Element Locators

Browser commands use element locators to target specific DOM elements:

CSS Selectors

{
  "elementsLocator": {
    "selector": ".article-title",
    "timeout": 10000
  }
}

Advanced Locator Features

  • Filtering: Filter by innerText, hasChildren, or index
  • Chained Locators: Use continueWith for nested searches
  • Multiple Elements: Returns arrays for multiple matching elements

Best Practices

  • Use Session IDs: Leverage #{UUID} for maintaining browser state
  • Set Appropriate Timeouts: Configure timeouts for dynamic content loading
  • Wait for Elements: Ensure elements are loaded before interaction
  • Handle Dynamic Content: Account for JavaScript-rendered content
  • Use Descriptive Selectors: Use clear, stable CSS selectors