Skip to content

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

log line before browser is killed instead of after

Nick Sweeting1b588328a3c9
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 393c6bae8..14e2b00d5 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -395,8 +395,8 @@ class BrowserSession(BaseModel):
try:
proc = psutil.Process(pid=self.browser_pid)
executable_path = proc.cmdline()[0]
+ self.logger.info(f' ↳ Killing browser_pid={self.browser_pid} {_log_pretty_path(executable_path)}')
proc.terminate()
- self.logger.info(f' ↳ Killed browser_pid={self.browser_pid} {_log_pretty_path(executable_path)}')
self.browser_pid = None
except Exception as e:
if 'NoSuchProcess' not in type(e).__name__: