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
Adding .python-version to .gitignore.
Carlos Andrés Planchón Prestes831558bb9f3d
diff --git a/.gitignore b/.gitignoreindex c328cfc9a..a2a7b9d42 100644--- a/.gitignore+++ b/.gitignore@@ -186,3 +186,4 @@ gcp-login.json*.csv*.json*.jsonl+.python-versiondiff --git a/.python-version b/.python-versionindex 2c0733315..def4b3b8f 100644--- a/.python-version+++ b/.python-version@@ -1 +1 @@-3.11+browseruse3132diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex b9f3db316..522f68cc5 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -498,7 +498,11 @@ class Agent(Generic[Context]):return False, False# @observe(name='agent.run', ignore_output=True)- async def run(self, max_steps: int = 100) -> AgentHistoryList:+ async def run(+ self,+ max_steps: int = 100,+ after_step_func: Callable | None = None+ ) -> AgentHistoryList:"""Execute the task with maximum number of steps"""try:self._log_agent_run()@@ -526,6 +530,8 @@ class Agent(Generic[Context]):await self.step()+ await after_step_func(self)+if self.state.history.is_done():if self.settings.validate_output and step < max_steps - 1:if not await self._validate_output():