Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs/guides/agent/agent_component_reference/browser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
sidebar_position: 28
slug: /browser_component
sidebar_custom_props: {
categoryIcon: LucideSwatchBook
}
---
# Browser component

A component that autonomously navigates web pages and extracts specific content using standard formats or custom selectors.

---

A **Browser** component is usually the downstream of an input component or a search API component that provides URLs, and the upstream of an LLM component for summarization or analysis.

## Scenarios

A **Browser** component is essential when you need the agent workflow to fetch real-time data from external websites, scrape specific dynamic elements, or navigate web pages before passing the extracted content to an LLM.

## Configurations

### Action type

Select the primary operation the browser will perform. For example, selecting **Get page content** instructs the component to retrieve the text and structure of the target webpage.

### URL input

*Mandatory*

Specify the web address the browser should navigate to. This field accepts dynamic variables from upstream components. For instance, you can reference a variable like `{{search_results_url}}` generated by a previous search component.

### Selectors

Define the specific data points to extract from the loaded web page. You can add multiple selectors to extract different pieces of information simultaneously.

- **HTML**: Allows you to extract broad page elements, such as the full HTML of the document.
- **CSS selector**: Allows you to pinpoint exact data using standard CSS selectors (e.g., `.product-title` or `.product-price`). This is highly useful for targeting specific text blocks, tables, or item attributes within a structured webpage.

### JavaScript enabled

A toggle to determine if the browser should execute JavaScript on the target page. Setting this to **True** is highly recommended for scraping modern websites where content is dynamically rendered after the initial page load.

### Wait for

Configure delay conditions to ensure the page has fully loaded before the component attempts to extract data.

- **Wait for element**: Pauses the extraction until a specific CSS class or ID (e.g., `results-container`) becomes visible on the page.
- **Input (seconds)**: Imposes a strict time delay (e.g., `5 seconds`) to give the browser ample time to load all assets and execute background scripts.

Comment on lines +22 to +49
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Documented configuration fields do not match the actual Browser component contract.

This section describes Action type, mandatory URL input, Selectors, JavaScript enabled, and Wait for, but the component input contract in agent/component/browser.py exposes prompts and upload_sources via BrowserParam.get_input_form() (line range 46-80), with runtime params like max_steps, headless, enable_default_extensions, chromium_sandbox, and persist_session. Please align this page to the implemented parameters to avoid invalid workflow setup guidance.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/agent/agent_component_reference/browser.md` around lines 22 - 49,
The docs section lists fields that do not match the Browser component contract;
update the browser.md content to reflect the actual inputs and runtime params
exposed by BrowserParam.get_input_form() in agent/component/browser.py: document
the input fields prompts and upload_sources (including their shapes/usage), and
document runtime parameters max_steps, headless, enable_default_extensions,
chromium_sandbox, and persist_session (their types, defaults, and intended
behavior) instead of the obsolete Action type/URL/Selectors/JavaScript/Wait-for
items so the guide matches the implemented component contract.

### Output variables

The **Browser** component provides three distinct outputs that can be referenced by downstream components in the workflow:

- **Full text**: The raw text content extracted from the page or the targeted selectors.
- **JSON data**: A structured representation of the extracted elements.
- **Error code**: Captures and outputs any HTTP errors or navigation failures encountered during the process.
Comment on lines +50 to +56
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Output variable names/types are inconsistent with implementation.

The docs list Full text, JSON data, and Error code, but the component actually emits content and downloaded_files (see agent/component/browser.py:46-80 and _invoke at 665-713), and writes errors to _ERROR as an exception string (not an HTTP error code). Please update the documented output variables to the real keys and semantics.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/agent/agent_component_reference/browser.md` around lines 50 - 56,
Docs incorrectly list output variables; update the Browser component docs to
match the actual emitted keys and semantics used by the implementation: replace
"Full text/JSON data/Error code" with the real outputs `content` (string with
the extracted page/selectors text), `downloaded_files` (array/list of downloaded
file metadata), and `_ERROR` (exception string written on failure, not an HTTP
status code); reference the Browser component and its _invoke method to ensure
descriptions match how `content`, `downloaded_files`, and `_ERROR` are produced
and when each is present.