Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Merge branch 'main' into schema-enforced-extraction
Saurav Pandaba68695d654a
diff --cc browser_use/tools/views.pyindex 654fcd656,4eb7edb4f..e87ed840b--- a/browser_use/tools/views.py+++ b/browser_use/tools/views.py@@@ -13,12 -12,27 +13,31 @@@ class ExtractAction(BaseModel)start_from_char: int = Field(default=0, description='Use this for long markdowns to start from a specific character (not index in browser_state)')+ output_schema: SkipJsonSchema[dict | None] = Field(+ default=None,+ description='Optional JSON Schema dict. When provided, extraction returns validated JSON matching this schema instead of free-text.',+ )+ class SearchPageAction(BaseModel):+ pattern: str = Field(description='Text or regex pattern to search for in page content')+ regex: bool = Field(default=False, description='Treat pattern as regex (default: literal text match)')+ case_sensitive: bool = Field(default=False, description='Case-sensitive search (default: case-insensitive)')+ context_chars: int = Field(default=150, description='Characters of surrounding context per match')+ css_scope: str | None = Field(default=None, description='CSS selector to limit search scope (e.g. "div#main")')+ max_results: int = Field(default=25, description='Maximum matches to return')+++ class FindElementsAction(BaseModel):+ selector: str = Field(description='CSS selector to query elements (e.g. "table tr", "a.link", "div.product")')+ attributes: list[str] | None = Field(+ default=None,+ description='Specific attributes to extract (e.g. ["href", "src", "class"]). If not set, returns tag and text only.',+ )+ max_results: int = Field(default=50, description='Maximum elements to return')+ include_text: bool = Field(default=True, description='Include text content of each element')++class SearchAction(BaseModel):query: strengine: str = Field(