Enable AI to control your browser 🤖.
Browser use is the easiest way to connect your AI agents with the browser. If you have used Browser Use for your project feel free to show it off in our Discord.
To learn more about the library, check out the documentation 📕.
With pip:
pip install browser-use
(optional) install playwright:
playwright install
Spin up your agent:
from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio
async def main():
agent = Agent(
task="Go to Reddit, search for 'browser-use' in the search bar, click on the first post and return the first comment.",
llm=ChatOpenAI(model="gpt-4o"),
)
result = await agent.run()
print(result)
asyncio.run(main())
And don't forget to add your API keys to your .env
file.
OPENAI_API_KEY=
For other settings, models, and more, check out the documentation 📕.
You can test browser-use with a UI repository
Or simply run the gradio example:
uv pip install gradio
python examples/gradio.py
Prompt: Write a letter in Google Docs to my Papa, thanking him for everything, and save the document as a PDF.
Prompt: Read my CV & find ML jobs, save them to a file, and then start applying for them in new tabs, if you need help, ask me.'
apply.to.jobs.8x.mp4
Prompt: Find flights on kayak.com from Zurich to Beijing from 25.12.2024 to 02.02.2025.
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.
hugging_face_high_quality.mp4
For more examples see the examples folder or join the Discord and show off your project.
Tell your computer what to do, and it gets it done.
Contributions are welcome! Feel free to open issues for bugs or feature requests.
To learn more about the library, check out the local setup 📕.