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 ruff-format issue: remove trailing whitespace
MagellaX67006daed0d0
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex bbba98749..8f30a2d35 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1657,10 +1657,10 @@ class Agent(Generic[Context, AgentStructuredOutput]):# playwright browser is always immediately killed by the first Ctrl+C (no way to stop that)# so we need to restart the browser if user wants to continue# the _init() method exists, even through its shows a linter error- if self.browser:+ if self.browser_session and self.browser_session.browser:self.logger.info('🌎 Restarting/reconnecting to browser...')loop = asyncio.get_event_loop()- loop.create_task(self.browser._init()) # type: ignore+ loop.create_task(self.browser_session.browser._init()) # type: ignoreloop.create_task(asyncio.sleep(5))def stop(self) -> None:diff --git a/examples/models/langchain/chat.py b/examples/models/langchain/chat.pyindex b60d15c9b..30c2020cb 100644--- a/examples/models/langchain/chat.py+++ b/examples/models/langchain/chat.py@@ -239,7 +239,7 @@ class ChatLangchain(BaseChatModel):message=f'LangChain model error: {str(e)}',model=self.name,) from e-+# This should never be reached, but add fallback for type checkerraise ModelProviderError(message='Unexpected code path reached in ainvoke',