Skip to main content

browser-daemon-client

Async Python client for browser-daemon, with nothing but aiohttp: made for Home Assistant integrations and other code that cannot carry Playwright.

import aiohttp
from browser_daemon_client import BrowserDaemon, RunError, step

async with aiohttp.ClientSession() as http:
    bd = BrowserDaemon(
        http, "https://browser.example.org", secret, client="Home Assistant · HR WORKS"
    )
    try:
        res = await bd.run(
            profile="work",
            url="https://hr.example.org/login",
            steps=[
                step.fill("#user", arg="user"),
                step.fill("#password", arg="password"),
                step.click("role=button[name='Sign in']"),
                step.wait_for(".dashboard"),
                step.text(".balance", as_="balance"),
            ],
            args={"user": user, "password": password},
        )
    except RunError as err:
        print(err, err.run.url)  # err.run.screenshot: the tab, as a base64 PNG
    else:
        print(res.result["balance"])
  • run(): a Playwright script (a JavaScript function expression) or steps, in a profile's browser, a session or a throwaway browser. Runs for a profile go to the node that has it. See docs/run.md.
  • login(session_id, tab, username, password, ...): submit credentials in an existing Chromium tab and return a LoginResult.outcome. Set success_selector to visible page evidence before treating the result as authenticated; see docs/run.md.
  • overview(), find_profile(), sessions(), session(), create_session(), delete_session(), set_idle_timeout(), tabs(), open_tab(), close_tab(), export_auth() (a page's cookies and storage; never log them).
  • place_browser(profile=..., node=..., group=..., engine=...) selects a matching node and moves an idle existing profile there. create=True permits a missing profile for a subsequent session or run; it reserves nothing.
  • create_session(profile="work", group="cloud") places the profile before opening it and returns node_name for subsequent node-specific calls. Supplying both profile and node also enables automatic placement. See profile placement for transfer restrictions and failure behavior.
  • create_session(ephemeral_node=True) provisions a dedicated node and returns its node_url alongside the session. Connect to that node with the session ID; the session and node are removed after the last client disconnects.
  • node= sends a request to another node of the mesh through this one.
  • read_secret() reads the cluster secret from its file.

Errors are BrowserDaemonError (with status), and for runs RunError and RunTimeout (with the whole answer in .run).

Releasing

The client has the daemon's version and is released with it: just release-prepare X.Y.Z bumps pyproject.toml with Cargo.toml, and the signed vX.Y.Z tag makes the python job of the release workflow publish it to PyPI through trusted publishing (the pypi environment; no token is stored anywhere). test.yaml tests it on every change.

Metadata

Release files for browser-daemon-client 0.15.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for browser-daemon-client 0.15.5
File Size Uploaded Provenance Actions
browser_daemon_client-0.15.5.tar.gz 17.9 kB With provenance Details for browser_daemon_client-0.15.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for browser-daemon-client 0.15.5
File Interpreter ABI Platform Actions
browser_daemon_client-0.15.5-py3-none-any.whl Python 3 none any Details for browser_daemon_client-0.15.5-py3-none-any.whl

Total release size: 25.5 kB

Release files / browser_daemon_client-0.15.5.tar.gz

Download URL browser_daemon_client-0.15.5.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e9976abdb10c426bc56236ee71e1f46b2aadee32d9fe83b35a825c30b86aa8
BLAKE2b-256 checksum
How to use checksums
d623baea4be192173897c532ce63b8a9cac90c5b2a331ccecebe5d92c7e04b5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / browser_daemon_client-0.15.5-py3-none-any.whl

Download URL browser_daemon_client-0.15.5-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33b50f86ea31013349c6fbd528b2874ff15d66b98af0599eb3b7d2bfaa6995e0
BLAKE2b-256 checksum
How to use checksums
a10115eba7adeb055344499d8a08b296e7be2c527fd5d53acf57e9798382ee6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for browser-daemon-client 0.15.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for browser_daemon_client-0.15.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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