Browser Use: The Python Library for Building Browser-Controlling AI Agents
🌐 Make websites accessible for AI agents. Automate tasks online with ease.
At a glance
- What is it?
- Browser Use is an open-source Python library that lets an AI agent control a real browser, navigate pages, fill forms, and extract data. It ships three deployment paths: a fully hosted cloud API, a CLI for adding browser access to existing coding agents, and a Python library for embedding browser automation in custom applications.
- Who is it for?
- Browser Use is a practical choice for engineers building AI agents that need to interact with real websites, especially those behind login walls or protected by Cloudflare Turnstile. The Python library path suits developers who want full control over the agent loop and model selection.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What Browser Use Solves and Who It Is For
Many automation tasks require a real browser: websites that load content via JavaScript after the initial page load, login flows that set cookies, or pages protected by bot-detection systems like Cloudflare Turnstile. Browser Use makes those websites accessible to AI agents. The library provides an Agent class that takes a task description and a language model, then controls a Playwright-driven browser to complete the task. The README describes its target use cases: finding an available appointment slot, handling a CAPTCHA, and booking a driving test are all cited as examples. The library is aimed at Python developers building automation pipelines, AI agent applications, or data collection tools that cannot rely on static HTML scraping. An MCP server interface is also included for routing browser tasks from AI agent frameworks.
Three Deployment Paths: Cloud, CLI, and Python Library
Browser Use distinguishes three usage modes. Path 1 is the fully hosted cloud: send a task to the Browser Use API and the service runs the agent and browser infrastructure, managing profiles, recordings, and data policies. New signups receive $15 in cloud credit. Path 2 is the CLI: paste the install prompt into an existing coding agent such as Claude Code to add browser access to that agent. Path 3 is the Python library: run the open-source agent locally with a chosen language model and either a local or cloud browser. The CLI and Python library can each connect to a local browser (using Playwright) or a cloud browser from Browser Use's hosted infrastructure. The pyproject.toml lists the package as browser-use at version 0.13.10, requiring Python 3.11 or higher.
Installing Browser Use and Running a First Agent
With uv installed, add browser-use to your project:
uv add browser-useAdd your OpenAI API key to a .env file:
OPENAI_API_KEY=your-keyThen write a Python script that creates an agent with a task and a language model:
from browser_use import Agent, ChatBrowserUse, ChatOpenAI
from dotenv import load_dotenv
load_dotenv()
async def main():
llm = ChatOpenAI(model='gpt-5.6-luna', reasoning_effort='xhigh')
agent = Agent(
task="Find the number of stars of the browser-use repo",
llm=llm,
)
history = await agent.run()
print(history.final_result())Run the script:
uv run agent.pyThe agent opens a browser, navigates to the repository, and prints its answer. The .env.example in the repository documents all optional configuration variables including BROWSER_USE_LOGGING_LEVEL, ANONYMIZED_TELEMETRY, and BROWSER_USE_API_KEY for cloud browser or BU2 model access.
How the Agent Interprets Pages and Selects Actions
Browser Use wraps Playwright to drive Chromium. The agent receives the page content and a description of interactive elements, decides on an action (click, type, scroll, navigate), executes it through Playwright, and repeats until the task is complete or the agent determines it cannot proceed. The library uses markdownify for page text extraction to reduce the content passed to the language model. The pyproject.toml lists over thirty dependencies including aiohttp, playwright (via cdp-use), pypdf for reading PDFs encountered on pages, and mcp for Model Context Protocol integration. The Dockerfile builds a self-contained image that installs Chromium and all dependencies, exposing no ports by default.
Anti-Bot Bypass and Cloudflare Turnstile Handling
The README states that Browser Use handles Cloudflare Turnstile out of the box through StealthyFetcher-style behavior in the browser. The library includes a stealth browser option that makes the automated browser harder to distinguish from a human-operated one. For enterprise-grade protection systems beyond Cloudflare, the README references third-party proxy and antibot token services as options. Using these capabilities against websites that prohibit automated access may violate their terms of service. The library's .env.example includes configuration for proxy settings via the BROWSER_USE_EXECUTABLE_PATH and BROWSER_USE_HEADLESS variables.
Where Browser Use Is Not the Right Tool
Browser Use launches a real browser and uses an LLM to interpret each page, making it substantially slower and more expensive per request than an HTTP-based scraper or a static HTML parser. For websites that return complete HTML in the initial response and do not require interaction, libraries like httpx combined with a parser are faster and cheaper. Browser Use also requires a running LLM; the cost of API calls accumulates with task complexity. The pyproject.toml pin of anthropic==0.76.0, openai==2.26.0, and google-genai==1.65.0 means model provider API changes may require a library update before the corresponding provider works. The library is in beta (pyproject.toml classifies it as Development Status 4 - Beta).
Playwright as the Comparable Alternative
Playwright is the browser automation framework that Browser Use builds on. Writing Playwright automation directly gives full programmatic control over every browser interaction, requires no LLM, and produces deterministic scripts. Browser Use's difference is that it replaces explicit script authoring with a natural-language task description interpreted by a language model. Playwright scripts fail when the target page changes structure; Browser Use agents can adapt within the current session by observing the updated page state. The trade-off is cost (each page observation sends tokens to the LLM) versus brittleness (a Playwright script breaks silently when selectors change). The repository includes a docker-compose-style Dockerfile for running both in a container.
Editorial conclusion
Browser Use is a practical choice for engineers building AI agents that need to interact with real websites, especially those behind login walls or protected by Cloudflare Turnstile. The Python library path suits developers who want full control over the agent loop and model selection. The CLI path is the quickest option when the goal is adding browser access to an existing coding assistant. The fully hosted API removes infrastructure concerns but requires a Browser Use API key and incurs usage costs. Verify that your target website's terms of service permit automated access before deploying the library against it. The pyproject.toml requires Python 3.11 or higher.
Frequently asked questions
How do I install Browser Use?
Run uv add browser-use in a Python 3.11+ project. You also need an LLM API key (for example, OPENAI_API_KEY) in a .env file. The .env.example in the repository lists all optional configuration variables.
How do I use Browser Use?
Create an Agent with a task string and a language model instance, then await agent.run(). The agent controls a Playwright browser, navigates to the relevant pages, and returns a history object whose final_result() method gives the answer. Full examples are in the examples/ directory of the repository.
What is Browser Use in AI?
Browser Use is an open-source Python library that gives AI agents the ability to control a real browser. The agent receives a natural-language task, interprets web pages using a language model, and performs browser actions (click, type, navigate) to complete the task. It is aimed at automation tasks that require JavaScript rendering or user interaction.
Official sources
Where this project is recommended
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/browser-use-browser-use)
Community notes