Python SDK for controlling the native agent-browser engine in-process
Project description
pyagentbrowser
pyagentbrowser gives Python a native browser controller for Chrome. Import it
as agentbrowser and drive pages through page, find, agent, capture,
tabs, network, and cdp.
python -m pip install pyagentbrowser
Requires Python 3.11 through 3.14 on macOS or Linux, with Chrome or Chromium available on the host.
Use
The package root owns one process-local browser for REPLs, notebooks, and short scripts.
import agentbrowser as ab
ab.configure(launch={"headless": True})
try:
ab.page.open("https://example.com")
page = ab.agent.observe()
print(page.text)
ab.find.text("Learn more").click()
ab.page.wait_for_url("*://www.iana.org/*")
print(ab.page.url())
finally:
ab.close()
ab.reset(force=True) discards the default browser after an interrupted run.
Use Browser when a browser needs an explicit lifetime or when a program owns
more than one session.
from agentbrowser import Browser
with Browser.launch({"headless": True}) as browser:
browser.page.open("https://example.com")
print(browser.page.title())
Workflows
- Navigate pages, wait for load states, switch tabs, and attach to running Chrome through CDP.
- Observe accessibility snapshots, resolve refs by text, role, name, CSS, or XPath, then click, fill, press, or inspect matching elements.
- Capture action evidence with
click_and_observe()andfill_and_observe(). - Save screenshots, PDFs, cookies, storage state, network logs, console output, and session restore data.
- Drop to
browser.native.execute(...)for raw native commands orbrowser.cdpfor frame and execution-context work.
Extras
python -m pip install "pyagentbrowser[images]"
python -m pip install "pyagentbrowser[cdp]"
images adds Pillow helpers for screenshots. cdp adds WebSocket-backed frame,
target, and execution-context evaluation.
Docs
Acknowledgements
Built with Apache-2.0 source from Vercel Labs'
agent-browser. This project
is independent and not affiliated with Vercel.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyagentbrowser-0.31.1rc1.tar.gz.
File metadata
- Download URL: pyagentbrowser-0.31.1rc1.tar.gz
- Upload date:
- Size: 707.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d271b664864cc396db8f1394790cf2ae2304d682a88a591ab690f88cd327251a
|
|
| MD5 |
495b08e58fa8ce3e2c2110d03acb0aac
|
|
| BLAKE2b-256 |
1b212ef00ceeb841eb1a92fbd79221cc002ab8dfee0ffb35ac80c5f5a2106873
|
File details
Details for the file pyagentbrowser-0.31.1rc1-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyagentbrowser-0.31.1rc1-cp311-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d73bc54acf2e6a322fd8dfca570a119d220063337e954415014ec9cbd91c7ee7
|
|
| MD5 |
a8066fae7721957793ceabb4cd2522a0
|
|
| BLAKE2b-256 |
854f016295003029546a27c4e5cf7f588da306b00a7c0ad2c4a081e5fa26088c
|
File details
Details for the file pyagentbrowser-0.31.1rc1-cp311-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyagentbrowser-0.31.1rc1-cp311-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 8.8 MB
- Tags: CPython 3.11+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8be14aabe9f8f288fd3c91bd0b39d05e80e39f39cceac074a30e7b6ca6f7a076
|
|
| MD5 |
12c53c42c2913d8b7d348f39b6f79198
|
|
| BLAKE2b-256 |
1300559a21287d767e27d7999ab31e05b0f7fe6592a8e80d5a4a48543d3ca044
|
File details
Details for the file pyagentbrowser-0.31.1rc1-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyagentbrowser-0.31.1rc1-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b287199b46c6934489aa5604b37f5c460abe870cf7814e5df38fb520322f1df
|
|
| MD5 |
b12e7d6336c9e48c15dc56b2a3f67f6f
|
|
| BLAKE2b-256 |
641c619f74fcf7e390f0d2ff9bbfef1419a9c63578e07c62d03748ff879ca695
|
File details
Details for the file pyagentbrowser-0.31.1rc1-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyagentbrowser-0.31.1rc1-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 8.7 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea212b5e03ab09e19182884df6b91d5d7a628af4988e829b37966098b0cff85c
|
|
| MD5 |
aad6d4b09b6233e8fe7c5e13ef01c47a
|
|
| BLAKE2b-256 |
6b8a472c6e7207ee24193ecfc7a5c6bf632c40d66771df85f6b11123dd31f0d6
|