Skip to main content
Each script runs as is after the Quickstart (uv add 'browser-use==1.0.0' and export BROWSER_USE_API_KEY=bu_...). Save it as a file and run it with uv run <file>.py. They use the default model, bu-fast, and a Browser Use Cloud browser unless they say otherwise. Every one was run end to end against browser-use 1.0; the outputs shown are from those runs.

Extract data into a Pydantic model

Pass a type as output_model_schema and read a typed instance back. See Output.
extract.py
Output

Fill and submit a form

Describe every field in the task. The agent finds the inputs, fills them and submits.
form.py
Output

Log in with secrets

The model sees the names username and password, never the values, and they are typed only on the site you scope them to. See Secrets.
login.py
Output
For logins you don’t want typed at all, reuse a logged-in profile: Browser(cloud_profile_id=...) or Browser('chrome', profile='Work'). See Browsers.

Run agents in parallel

One Browser() per agent, then asyncio.gather. Two agents on one browser at once raise RuntimeError.
parallel.py
Output

Upload and download files

Put the file in the agent’s workspace and name it in the task. Downloads land in workspace/downloads and are listed in result.downloads. This one uses a local Chromium. See Files.
files.py
Output

Give the agent your own tool

A decorated function runs in your process with the arguments the model passes: write to your database, call an internal API, ask for a 2FA code. See Tools.
custom_tool.py
Output

Use a cloud browser in another country

Cloud browsers come with a residential proxy ('us' by default), CAPTCHA solving and stealth. live_view=True opens a live view you can watch; cloud_profile_id=... keeps logins between runs. See Browsers.
cloud.py
Output

Combine with Playwright

Playwright and the agent can share one browser over CDP. Here Playwright logs in deterministically, and the agent picks up in the same session. Install Playwright first: uv add playwright && uv run playwright install chromium.
with_playwright.py
Output
The agent connects with Browser(cdp_url=...) and leaves the browser running when it ends, so Playwright can keep going. Use launch_persistent_context: a plain launch() + new_page() opens an isolated context whose cookies the agent’s tabs would not see.

More

  • Follow-up tasks on the same page: Long tasks.
  • A local model with Ollama: Models.
  • Faster runs with bu-ultrafast: Ultrafast.
  • Restrict where the browser can go: Domains.

Older example apps

ad-use, vibetest-use, news-use and msg-use were built on browser-use 0.x and need browser-use<1. Their pages are kept in the 0.x docs: ad-use, vibetest-use, news-use, msg-use. The 0.x templates are under legacy templates.