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
lint
Laith Weinberger3dd56ff85fcd
diff --git a/browser_use/browser/watchdog_base.py b/browser_use/browser/watchdog_base.pyindex e8097dffb..b7569fbd2 100644--- a/browser_use/browser/watchdog_base.py+++ b/browser_use/browser/watchdog_base.py@@ -178,9 +178,7 @@ class BaseWatchdog(BaseModel):event_bus.on(event_class, unique_handler)@staticmethod- def detach_handler_from_session(- browser_session: 'BrowserSession', event_class: type[BaseEvent[Any]], handler- ) -> None:+ def detach_handler_from_session(browser_session: 'BrowserSession', event_class: type[BaseEvent[Any]], handler) -> None:"""Detach a single event handler from a browser session."""event_bus = browser_session.event_busdiff --git a/browser_use/tools/service.py b/browser_use/tools/service.pyindex c5b1e1066..7f47da93e 100644--- a/browser_use/tools/service.py+++ b/browser_use/tools/service.py@@ -1164,7 +1164,7 @@ You will be given a query and the markdown of a webpage that has been filtered t# Check if a matching download already existsalready_downloaded = find_matching_download()if already_downloaded:- result_msg = f"Download completed: {already_downloaded['file_name']} ({already_downloaded['file_size']} bytes) saved to {already_downloaded['path']}"+ result_msg = f'Download completed: {already_downloaded["file_name"]} ({already_downloaded["file_size"]} bytes) saved to {already_downloaded["path"]}'logger.info(f'📥 {result_msg}')return ActionResult(extracted_content=result_msg,@@ -1193,17 +1193,17 @@ You will be given a query and the markdown of a webpage that has been filtered ttry:await asyncio.wait_for(download_complete.wait(), timeout=params.timeout)- result_msg = f"Download completed: {downloaded_file_info['file_name']} ({downloaded_file_info['file_size']} bytes) saved to {downloaded_file_info['path']}"+ result_msg = f'Download completed: {downloaded_file_info["file_name"]} ({downloaded_file_info["file_size"]} bytes) saved to {downloaded_file_info["path"]}'logger.info(f'📥 {result_msg}')return ActionResult(extracted_content=result_msg,include_in_memory=True,)- except asyncio.TimeoutError:+ except TimeoutError:# Check one more time in case download completed but event was missedfinal_check = find_matching_download()if final_check:- result_msg = f"Download completed: {final_check['file_name']} ({final_check['file_size']} bytes) saved to {final_check['path']}"+ result_msg = f'Download completed: {final_check["file_name"]} ({final_check["file_size"]} bytes) saved to {final_check["path"]}'logger.info(f'📥 {result_msg}')return ActionResult(extracted_content=result_msg,