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
Raise error if browser start fails
Magnus Müller0ec47ecd3d49
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex 5176046be..2ca218335 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -425,7 +425,10 @@ class BrowserSession(BaseModel):async def start(self) -> None:"""Start the browser session."""- await self.event_bus.dispatch(BrowserStartEvent())+ start_event = self.event_bus.dispatch(BrowserStartEvent())+ await start_event+ # Ensure any exceptions from the event handler are propagated+ await start_event.event_result(raise_if_any=True, raise_if_none=False)async def kill(self) -> None:"""Kill the browser session and reset all state."""