Overview
Browser Use provides powerful data extraction capabilities:- LLM-based extraction - Natural language queries
- Structured output - Type-safe Pydantic models
- Zero-cost tools -
search_pageandfind_elements - Large content handling - Automatic chunking
- Link extraction - URLs and hrefs
Basic Extraction
Simple Extract Query
Extract with Links
Structured Output
Use Pydantic models for type-safe extraction:1
Define Your Schema
2
Pass Schema to Agent
3
Parse Results
Complete Example
Advanced Extraction
Chunked Extraction
For large pages, usestart_from_char to extract in chunks:
- First call: extracts 0 to 100,000 chars
- If truncated, response includes
next_start_char - Agent calls extract again with
start_from_char=100000
Custom Extraction Schema
Pass schema directly in the extract action:Zero-Cost Extraction Tools
These tools don’t use the LLM, so they’re instant and free:search_page
Find text patterns on the page:pattern: Text or regex pattern to searchregex: Set toTruefor regex patternscase_sensitive: Case-sensitive matchingcontext_chars: Characters of context around matchesmax_results: Limit results returnedcss_scope: Search within specific element
find_elements
Query DOM elements by CSS selector:selector: CSS selector (e.g.,.class,#id,tag[attr="value"])attributes: List of attributes to extractinclude_text: Include element text contentmax_results: Limit results
Multi-Page Extraction
Sequential Pages
Pagination with Custom Tool
Table Extraction
Simple Tables
Large Tables with Scrolling
Dynamic Content
Wait for Content Load
Infinite Scroll
AJAX/API Responses
Saving Extracted Data
To CSV
To JSON
To Database
Best Practices
1
Be Specific
✅ Good:❌ Bad:
2
Use Structured Output
Define Pydantic models for type safety and validation:
3
Handle Large Content
Let the agent handle chunking automatically:
4
Use Zero-Cost Tools When Possible
Troubleshooting
Incomplete Extraction
Increase max_steps:Extraction Timeouts
Increase timeouts:Missing Data
Wait for dynamic content:Next Steps
Structured Output Example
See full working example
Custom Tools
Build extraction tools
Production
Scale extraction workflows
Available Tools
See all extraction tools