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 link docs
Magnus Müllercfb3dbdb9861
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdxindex c93e63a45..4f2ac0e9f 100644--- a/docs/quickstart.mdx+++ b/docs/quickstart.mdx@@ -150,3 +150,26 @@ if __name__ == "__main__":</CodeGroup><Note> Custom browsers can be configured in one line. Check out <a href = "customize/browser/basics">browsers</a> for more. </Note>++## Advanced: CodeAgent for Local Code Execution++For tasks that require combining browser automation with local code execution (like processing data, saving files, or running computations), use the `CodeAgent`:++```python+import asyncio+from browser_use.code_use import CodeAgent++async def main():+ task = "Go to Hacker News, extract the top 10 posts, and save them to posts.json"+ agent = CodeAgent(task=task, max_steps=25)++ try:+ session = await agent.run()+ finally:+ await agent.close()++if __name__ == "__main__":+ asyncio.run(main())+```++The `CodeAgent` executes Python code locally (like Claude Code) while having full access to browser automation capabilities. Learn more in the <a href="customize/agent/code-agent">CodeAgent documentation</a>.diff --git a/examples/simple.py b/examples/simple.pyindex 5bd166b27..8446e9575 100644--- a/examples/simple.py+++ b/examples/simple.py@@ -11,7 +11,8 @@ from browser_use import Agent, ChatBrowserUseload_dotenv()agent = Agent(- task='Find the number of stars of the following repos: browser-use, playwright, stagehand, react, nextjs',+ task='https://wcpdev.wd101.myworkday.com/wday/authgwy/nayyabow_wcpdev2/login.html?returnTo=%2fnayyabow_wcpdev2%2fd%2fhome.html go here click and then fill with example data, use only send keys ',+ # task='go to duckduckgo.com search for browser-use but use only send keys validate the results, go to first link',llm=ChatBrowserUse(),)agent.run_sync()