Skip to content

Latest commit

History

68 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pyagentbrowser

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

DocumentationGet startedExamplesPyPIIssues

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

Control browsers from Python with the native agent-browser engine. Inspect a page, act on an element, and get the before-and-after snapshots with a diff of what changed.

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

Get started

python -m pip install pyagentbrowser

Requires Python 3.11 through 3.14. Local browsers run headlessly by default. The first launch finds Chrome or Chromium, or downloads Chrome for Testing when needed.

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

observe() captures a Snapshot of the page's accessible elements. Selecting a button returns a Ref. Clicking it returns an ActionResult with before, after, and diff. Use browser.find for live element queries.

Browser workflows

  • Inspect and act. Navigate pages, fill forms, read documents, and capture screenshots and PDFs through typed namespaces.
  • Manage sessions. Launch a browser or attach to an existing one. Work with tabs, cookies, saved state, and explicit cleanup.
  • Control actions. Configure domain restrictions and confirmation policy for operations through the native engine.
  • Compose in Python. Use synchronous or asynchronous controllers, agent skills, and the complete engine protocol through browser.native.

Documentation

Get startedConceptsAction evidenceSafetyAPI referenceTroubleshooting

The documentation site covers browser workflows, optional packages, supported platforms, and integrations. See examples for Python scripts and Contributing for development setup and checks.

License

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

Releases

Packages

Contributors

Languages