Skip to content

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

Example output

magmueller4f8b61d3891d
diff --git a/examples/agent_output_processing.py b/examples/agent_output_processing.py
new file mode 100644
index 000000000..0d58b47a2
--- /dev/null
+++ b/examples/agent_output_processing.py
@@ -0,0 +1,28 @@
+import os
+import sys
+
+from browser_use.controller.service import Controller
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+import asyncio
+
+from langchain_openai import ChatOpenAI
+
+from browser_use import Agent
+
+llm = ChatOpenAI(model='gpt-4o')
+
+agent = Agent(
+ task="Navigate to 'google.com' and type 'OpenAI' into the search bar. Then click the search button.",
+ llm=llm,
+ controller=Controller(keep_open=True, headless=False),
+)
+
+
+async def main():
+ await agent.run()
+
+
+if __name__ == '__main__':
+ asyncio.run(main())