Skip to content

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

tweak closing log msg

Nick Sweeting2c7c7eeca193
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index c3d4a9e70..bf9066560 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -369,7 +369,7 @@ class BrowserSession(BaseModel):
return # nothing to do if keep_alive=True, leave the browser running
if self.browser_context or self.browser:
- self.logger.info(f'🛑 Closing {self._connection_str} browser context {self.browser_context or self.browser}')
+ self.logger.info(f'🛑 Closing {self._connection_str} browser context {self.browser or self.browser_context}')
# Stop trace recording before closing context
if self.browser_profile.traces_dir and self.browser_context is not None: