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
Browser Open
Open a browser session and navigate to a URL
Get Text Contents
Extract text content from DOM elements
Get Attributes
Extract attributes from DOM elements
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 Parameters
Browser commands typically support the following parameters:| Parameter | Type | Description | Required |
|---|---|---|---|
| sessionId | string | Session identifier for maintaining state | No |
| url | string | URL to navigate to | Yes (for browser-open) |
| selector | string | CSS selector for element targeting | Yes (for interaction commands) |
| timeout | number | Maximum wait time in milliseconds | No |
| elementsLocator | object | Element locator configuration | Yes (for extraction commands) |
Element Locators
Browser commands use element locators to target specific DOM elements:CSS Selectors
Advanced Locator Features
- Filtering: Filter by innerText, hasChildren, or index
- Chained Locators: Use
continueWithfor 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
Related Commands
- Interaction Commands - User interaction commands
- Parse Commands - Parse extracted browser content
- Validation Commands - Validate extracted content