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 double space
Magnus Müllere69ba30db6c5
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.pyindex ee3140373..1051fc3ee 100644--- a/browser_use/tools/service.py+++ b/browser_use/tools/service.py@@ -703,7 +703,7 @@ You will be given a query and the markdown of a webpage that has been filtered treturn ActionResult(error=msg)direction = 'down' if params.down else 'up'- target = '' if params.index is None or params.index == 0 else f'element {params.index}'+ target = f'element {params.index}' if params.index is not None and params.index != 0 else ''# Get actual viewport height for more accurate scrollingtry:@@ -770,9 +770,9 @@ You will be given a query and the markdown of a webpage that has been filtered tlogger.warning(f'Fractional scroll failed: {e}')if params.pages == 1.0:- long_term_memory = f'Scrolled {direction} {target} {viewport_height}px'+ long_term_memory = f'Scrolled {direction} {target} {viewport_height}px'.replace(' ', ' ')else:- long_term_memory = f'Scrolled {direction} {target} {completed_scrolls:.1f} pages'+ long_term_memory = f'Scrolled {direction} {target} {completed_scrolls:.1f} pages'.replace(' ', ' ')else:# For fractional pages <1.0, do single scrollpixels = int(params.pages * viewport_height)@@ -781,7 +781,7 @@ You will be given a query and the markdown of a webpage that has been filtered t)await eventawait event.event_result(raise_if_any=True, raise_if_none=False)- long_term_memory = f'Scrolled {direction} {target} {params.pages} pages'+ long_term_memory = f'Scrolled {direction} {target} {params.pages} pages'.replace(' ', ' ')msg = f'🔍 {long_term_memory}'logger.info(msg)