Skip to content

Repository files navigation

Browser Use + CapSolver Agent examples

Demo repository CI License: ISC

Runnable examples showing how a Browser Use agent can call the official capsolver-agent tools when a supported CAPTCHA interrupts an authorized browser task.

This is an examples repository. It is not a separately published Python package and does not contain another CapSolver SDK.

Repository scope

This repository contains This repository does not contain
Browser Use action registration A browser-use-capsolver PyPI package
Runnable integration examples Duplicated solving or browser-detection logic
Environment and CI templates Independent SDK releases or versioning

CapSolver behavior remains in capsolver-agent and its shared capsolver-core engine. This repository only demonstrates the framework wiring.

How it works

  1. Browser Use decides that a supported CAPTCHA is blocking the authorized task.
  2. A registered Browser Use action calls capsolver_agent.create_executor().
  3. The executor runs the canonical solve_captcha or account tool.
  4. The structured result returns to Browser Use so the original task can continue.

Quick start

Requirements: Python 3.10+, a CapSolver API key, and the model-provider key used by Browser Use.

git clone https://github.com/capsolver-ai/browser-use-capsolver.git
cd browser-use-capsolver
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

Export the values shown in .env.example, then run:

python examples/quickstart.py

The example intentionally uses a user-supplied task. Test only on pages and accounts you are authorized to automate.

Key integration code

from browser_use import Tools
from capsolver_agent import create_executor

tools = Tools()
capsolver = create_executor()

@tools.action(description="Solve a supported CAPTCHA in an authorized workflow.")
async def solve_captcha(captcha_type: str, website_url: str, website_key: str) -> str:
    result = await capsolver.execute("solve_captcha", {
        "captcha_type": captcha_type,
        "website_url": website_url,
        "website_key": website_key,
    })
    return str(result)

See examples/quickstart.py for the complete runnable flow.

Available CapSolver Agent tools

  • solve_captcha: solve using a known CAPTCHA type, page URL, and site key.
  • detect_captchas: inspect a page URL with the browser extra installed.
  • solve_on_page: detect, solve, and fill supported challenges in browser mode.
  • get_balance: retrieve the current CapSolver balance.
  • get_supported_captchas: list the capabilities in the installed SDK build.

Project layout

examples/quickstart.py   Browser Use action registration and agent run
requirements.txt         CapSolver Agent plus Browser Use
tests/test_demo.py        Offline structure and syntax checks
.github/workflows/ci.yml  Demo validation on supported Python versions

Documentation

Responsible use

Use these examples only for lawful, user-authorized automation that respects the target site's terms and policies. Never commit API keys, cookies, proxy credentials, solved tokens, or private target data.

Contributing and support

See CONTRIBUTING.md, SUPPORT.md, and SECURITY.md.

License and attribution

Licensed under the ISC License. Browser Use is a third-party project. This repository is maintained by CapSolver and is not affiliated with or endorsed by Browser Use.

About

Runnable Browser Use examples for calling CapSolver Agent tools in authorized browser workflows.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages