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
Update Add tokens logger
takuto yukid4b54c8e2920
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex bd6615de5..c445bfbf1 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -742,6 +742,9 @@ class Agent(Generic[Context]):else:logger.info('❌ Unfinished')+ total_tokens = self.state.history.total_input_tokens()+ logger.info(f'📝 Total tokens used (approximate): {total_tokens}')+if self.register_done_callback:await self.register_done_callback(self.state.history)