Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

More efficient scroll instruction

Magnus Müller89cb9ef95457
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index e685a0f2c..204fd5796 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -647,7 +647,9 @@ Provide the extracted information in a clear, structured format."""
raise RuntimeError(str(e))
@self.registry.action(
- 'Scroll the page by specified number of pages (set down=True to scroll down, down=False to scroll up, num_pages=number of pages to scroll like 0.5 for half page, 1.0 for one page, etc.). Optional index parameter to scroll within a specific element or its scroll container (works well for dropdowns and custom UI components). Use index=0 or omit index to scroll the entire page.',
+ """Scroll the page by specified number of pages (set down=True to scroll down, down=False to scroll up, num_pages=number of pages to scroll like 0.5 for half page, 3.0 for three pages, etc.). Optional index parameter to scroll within a specific element or its scroll container (works well for dropdowns and custom UI components). Don't use index to scroll the entire page.
+ Instead of scrolling multiple step after step, use a high number of pages at once like 10 to get to the bottom of the page.
+ """,
param_model=ScrollAction,
)
async def scroll(params: ScrollAction, browser_session: BrowserSession):