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
Fix param
Magnus Müllerad9b1747629c
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.pyindex dbed5a1dc..3d9598b31 100644--- a/browser_use/tools/service.py+++ b/browser_use/tools/service.py@@ -683,15 +683,15 @@ You will be given a query and the markdown of a webpage that has been filtered t# Look up the node from the selector map if index is provided# Special case: index 0 means scroll the whole page (root/body element)node = None- if params.frame_index is not None and params.frame_index != 0:- node = await browser_session.get_element_by_index(params.frame_index)+ if params.index is not None and params.index != 0:+ node = await browser_session.get_element_by_index(params.index)if node is None:# Element does not exist- msg = f'Element index {params.frame_index} not found in browser state'+ msg = f'Element index {params.index} not found in browser state'return ActionResult(error=msg)direction = 'down' if params.down else 'up'- target = 'the page' if params.frame_index is None or params.frame_index == 0 else f'element {params.frame_index}'+ target = 'the page' if params.index is None or params.index == 0 else f'element {params.index}'# Get actual viewport height for more accurate scrollingtry:diff --git a/browser_use/tools/views.py b/browser_use/tools/views.pyindex c73752ba0..8b6ab5cc1 100644--- a/browser_use/tools/views.py+++ b/browser_use/tools/views.py@@ -61,7 +61,7 @@ class CloseTabAction(BaseModel):class ScrollAction(BaseModel):down: bool = Field(description='1=down, 0=up')pages: float = Field(default=1.0, description='0.5=half, 1=pg, 10=bottom')- frame_index: int | None = Field(default=None, description='container index')+ index: int | None = Field(default=None, description='Use to scroll in specific container with that element')class SendKeysAction(BaseModel):@@ -69,7 +69,7 @@ class SendKeysAction(BaseModel):class UploadFileAction(BaseModel):- index: int = Field(description='index')+ index: intpath: str@@ -82,7 +82,7 @@ class NoParamsAction(BaseModel):class GetDropdownOptionsAction(BaseModel):- index: int = Field(ge=1, description='index')+ index: intclass SelectDropdownOptionAction(BaseModel):