Skip to main content

pyagentbrowser

Native browser automation with typed Python APIs and before-and-after evidence.

Documentation · Get started · Examples · PyPI · Issues

PyPI version Python 3.11 through 3.14 Release Check Apache-2.0 license

pyagentbrowser embeds the native Rust agent-browser engine in a Python process. A Browser controller owns startup, ordered native work, snapshot-scoped element refs, safety policy, direct browser capabilities, and terminal cleanup.

Alpha: The public API and native integration can change between minor releases. Pin a version for production automation.

Quickstart

Install pyagentbrowser from the Python Package Index:

python -m pip install pyagentbrowser

The first local launch selects a configured, cached, or installed Chrome or Chromium executable. When discovery finds none, pyagentbrowser downloads Chrome for Testing. Local browsers run headlessly by default.

from agentbrowser import Browser

with Browser.launch() as browser:
    browser.page.set_content(
        "<button onclick=\"this.textContent='Done'\">Run</button>"
    )
    snapshot = browser.observe()
    result = snapshot.one(role="button", name="Run").click()

    print(result.after.one(role="button").name)
    print(result.diff.changed)
Done
True

The evidence model

Browser.observe() returns an accessibility Snapshot. Each Ref identifies one element inside that snapshot. A ref mutation returns an ActionResult with the source snapshot, resulting snapshot, and their SnapshotDiff.

Snapshot A -> Ref -> action and wait -> Snapshot B -> SnapshotDiff

Use browser.find for live CSS, XPath, role, text, label, placeholder, alternative text, title, and test ID queries. Live queries resolve when each operation runs. Snapshot-scoped refs preserve the inspected page state and add transition evidence.

What you can automate

Choose a runtime

Browser is synchronous. AsyncBrowser mirrors its browser, snapshot, ref, query, policy, and capability APIs with awaitable native operations.

Browser.launch() starts a local browser before returning. Browser() starts lazily. Browser.attach(CDPTarget(...)) connects to an existing Chrome DevTools Protocol endpoint. All three paths share the same typed result and lifecycle model.

Installation options

Wheels support Python 3.11 through 3.14 on macOS arm64 and x86-64, manylinux 2.28-compatible Linux arm64 and x86-64, and Windows x86-64.

uv add pyagentbrowser
uv add "pyagentbrowser[images]"  # Pillow image loading for Screenshot
uv add "pyagentbrowser[cdp]"     # Direct Chrome DevTools Protocol clients

Learn and contribute

Serve the documentation through Portless with make docs-dev. The main checkout uses https://docs.pyagentbrowser.localhost/, while linked worktrees receive a branch-prefixed subdomain.

License

pyagentbrowser is licensed under the Apache License 2.0. See NOTICE for bundled software attribution.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyagentbrowser-0.36.0.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyagentbrowser-0.36.0.1-cp311-abi3-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_aarch64.whl (9.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

pyagentbrowser-0.36.0.1-cp311-abi3-macosx_11_0_arm64.whl (8.7 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

pyagentbrowser-0.36.0.1-cp311-abi3-macosx_10_12_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file pyagentbrowser-0.36.0.1.tar.gz.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1.tar.gz
Algorithm Hash digest
SHA256 c104da7b8a674a27ea7465b104b5defd31aacca92716b9a7556befe96895188e
MD5 2de9e32114d8c928718de41759651915
BLAKE2b-256 54df9b59c5dd807823cd571fca4fba893556952927450ca8c91be5f35632e175

See more details on using hashes here.

File details

Details for the file pyagentbrowser-0.36.0.1-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 9.1 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 96b849b1b725f66c902ed6300a2a68b8424c0895fee7728e28bf74e2eab3a5b0
MD5 db90f446b17c8c6df3432265a8f409c8
BLAKE2b-256 6c89bf2490aa8e9bf53a148cf9b8b09feed650ad52bceed4ee3c5102e035365c

See more details on using hashes here.

File details

Details for the file pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 292cbaf286a89f1078bbfc6a2190b58269a07e2de7eb4ca5112ce56d2543dcf0
MD5 14f6dad7d06feeaa98cd1957579853c1
BLAKE2b-256 b3790611b826e59a1165392941128e18cb17a9fc7e4d9a4539e79bb56c3a67bd

See more details on using hashes here.

File details

Details for the file pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 24d74b708dfc29cdf1f078696c49e57e1e15a6ab132644097ae51d0ee5e60c9a
MD5 4e144f4efec8f3677503a2ed8c1692aa
BLAKE2b-256 de9ee3c9bbd2840c86a7780730b4e036ad79b21674eb389877f71fd3c80f5088

See more details on using hashes here.

File details

Details for the file pyagentbrowser-0.36.0.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 8.7 MB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c414cf8e06a86cffb531e1a653f1ef786177800808e2b47230dffd42794fb95
MD5 d7ab1619c8355ab02566a80b50cd086d
BLAKE2b-256 6a3f01b57ca888567c3562411d06064ff552251a1df47349da2fe0fbe2031f4e

See more details on using hashes here.

File details

Details for the file pyagentbrowser-0.36.0.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: pyagentbrowser-0.36.0.1-cp311-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: CPython 3.11+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for pyagentbrowser-0.36.0.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a12291aba0fe4e905518b684f2bb38ddf750801ca1f4a7ec604a948c04e1cd9
MD5 1fc2b94a2717fac44942e123199e3fa0
BLAKE2b-256 87e1928d1809da9565fc208f888623a9f90104f2a6f2dda2f3b87de46abf2e2e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.37.0

6 files

0.36.0.2

6 files

This release

0.36.0.1 This release

6 files

0.36.0

6 files

0.35.1

6 files

0.35.0

6 files

0.34.0

6 files

0.33.1

6 files

0.33.0

6 files

0.32.3

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page