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
Included demos videos for flight search, captcha, and custom functions (#38)
Magnus Müller08802a753000
diff --git a/README.md b/README.mdindex b9b3c8d72..e8a4adbb6 100644--- a/README.md+++ b/README.md@@ -41,18 +41,22 @@ ANTHROPIC_API_KEY=# Demos-<div>- <a href="https://www.loom.com/share/63612b5994164cb1bb36938d62fe9983">- <img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/63612b5994164cb1bb36938d62fe9983-7133f9e169672e6f-full-play.gif">- </a>- <p><i>Prompt: Go to hackernews on show hn and give me top 10 post titles, their points and hours. Calculate for each the ratio of points per hour. (1x speed) </i></p>+<div style="font-size: 4em;">+ Prompt: Find flights on kayak.com from Zurich to Beijing on 25.12.2024 to 02.02.2025. (8x speed)</div>-<div>- <a href="https://www.loom.com/share/2af938b9f8024647950a9e18b3946054">- <img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/2af938b9f8024647950a9e18b3946054-b99c733cf670e568-full-play.gif">- </a>- <p><i>Prompt: Search the top 3 AI companies 2024 and find what out what concrete hardware each is using for their model. (1x speed)</i></p>++++<div style="font-size: 4em;">+ Prompt: Solve the captcha. (2x speed)</div>+<img src="https://github.com/MagMueller/examples-browser-use/blob/main/captcha/captcha%20big.gif" alt="Solving Captcha" style="max-width:300px;">++<div style="font-size: 4em;">+ Prompt: Look up models with a license of cc-by-sa-4.0 and sort by most likes on Hugging face, save top 5 to file. (1x speed)+</div>++https://github.com/user-attachments/assets/de73ee39-432c-4b97-b4e8-939fd7f323b3# Features ⭐diff --git a/examples/captcha.py b/examples/captcha.pynew file mode 100644index 000000000..1df96ff00--- /dev/null+++ b/examples/captcha.py@@ -0,0 +1,31 @@+"""+Simple try of the agent.++@dev You need to add OPENAI_API_KEY to your environment variables.+"""++import os+import sys++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++# NOTE: captchas are hard. For this example it works. But e.g. for iframes it does not.+# for this example it helps to zoom in.+llm = ChatOpenAI(model='gpt-4o')+agent = Agent(+ task='go to https://captcha.com/demos/features/captcha-demo.aspx and solve the captcha',+ llm=llm,+)+++async def main():+ await agent.run()+++asyncio.run(main())diff --git a/examples/flight_search.py b/examples/flight_search.pyindex 54bdc7daf..ffc1c94f8 100644--- a/examples/flight_search.py+++ b/examples/flight_search.py@@ -17,7 +17,7 @@ from browser_use import Agentllm = ChatOpenAI(model='gpt-4o')agent = Agent(- task='Find flights on kayak.com from Zurich to Beijing on 25.12.2024 one way, give me the cheapest among all',+ task='Find flights on kayak.com from Zurich to Beijing on 25.12.2024 to 02.02.2025',llm=llm,)