Skip to main content
Extraction actions retrieve information from web pages using LLM-powered extraction or visual snapshots.

extract

Use an LLM to extract structured or free-text data from the current page’s markdown content.
string
required
Description of what data to extract from the page
Set to True if the query requires URLs/links, False to save tokens
int
default:"0"
Character position to start extraction from. Use this for long pages when previous extraction was truncated.Note: This is a character offset in the markdown content, NOT an element index from browser_state.
dict
Optional JSON Schema dictionary. When provided, extraction returns validated JSON matching this schema instead of free-text.See Structured Output Example

Free-text Extraction Example

Structured Extraction Example

When to use extract:
  • You’re on the right page
  • You know what data to extract
  • You haven’t called extract before on the same page for the same query
Limitations:
  • Cannot extract interactive elements (use browser_state for that)
  • Large content may be truncated (use start_from_char to continue)
The extracted content is converted to markdown before extraction, which filters out advertising and noise but removes some interactive elements.
Implementation: browser_use.tools.service:951

screenshot

Take a screenshot of the current viewport.
string
Optional filename to save the screenshot. If provided, saves to file and returns the path.If omitted, the screenshot will be included in the next browser_state observation.Supported format: PNG (.png extension added automatically)

Save to File Example

Include in Observation Example

Screenshots are useful for:
  • Visual confirmation of page state
  • Debugging issues
  • Creating documentation
  • Verifying forms filled correctly
Implementation: browser_use.tools.service:1387

search_page

Search page text for a pattern instantly with zero LLM cost (like grep).
string
required
Text or regex pattern to search for in page content
bool
default:"False"
Treat pattern as regex (default: literal text match)
bool
default:"False"
Case-sensitive search (default: case-insensitive)
int
default:"150"
Characters of surrounding context per match
string
CSS selector to limit search scope (e.g., "div#main")
int
default:"25"
Maximum matches to return

Example

Zero LLM cost - This action executes JavaScript directly in the browser for instant results.
Implementation: browser_use.tools.service:1169

find_elements

Query DOM elements by CSS selector instantly with zero LLM cost.
string
required
CSS selector to query elements (e.g., "table tr", "a.link", "div.product")
list[string]
Specific attributes to extract (e.g., ["href", "src", "class"]).If not set, returns tag and text only.
int
default:"50"
Maximum elements to return
bool
default:"True"
Include text content of each element

Example

Use find_elements to:
  • Explore page structure
  • Count items
  • Get links/attributes
  • Verify elements exist
Implementation: browser_use.tools.service:1206