Skip to main content

WebDriver BiDi for Python — talk to any browser via W3C standard

Project description

bidiwave

WebDriver BiDi for Python — talk to any browser via W3C standard.

CI PyPI Python License

Features

  • W3C WebDriver BiDi — estándar, no CDP propietario
  • Cross-browser — Chrome, Firefox, Edge (Safari cuando soporte BiDi)
  • Async-firstasync/await nativo con asyncio
  • Event streaming — console logs, navegación, contexts en tiempo real
  • Type-safe — Pydantic v2 models, type narrowing con match
  • Sin dependencias pesadas — no requiere Selenium, no requiere Playwright

Install

pip install bidiwave

Quick start

import asyncio
from bidiwave import BiDiClient, StringValue

async def main():
    async with await BiDiClient.connect("ws://localhost:9222/session") as client:
        await client.session.new()

        async with await client.browsing.open("https://example.com") as page:
            # Evaluar JS
            result = await page.evaluate("document.title")
            match result:
                case StringValue(value=title):
                    print(f"Title: {title}")

            # Screenshot
            screenshot = await page.screenshot()
            with open("screenshot.png", "wb") as f:
                f.write(screenshot)

asyncio.run(main())

Console log monitoring

async with await BiDiClient.connect(url) as client:
    await client.session.new()

    async def on_log(entry):
        print(f"[{entry.level}] {entry.text}")

    client.on("log.entryAdded", on_log)
    await client.session.subscribe(["log.entryAdded"])

    async with await client.browsing.open("https://example.com") as page:
        await page.evaluate("console.log('hello!')")
        await asyncio.sleep(2)

Lanzar un browser con BiDi

Chrome

google-chrome --headless=new --remote-debugging-port=9222 --enable-bidi

Firefox

firefox --headless --remote-debugging-port=9223 --no-remote

Documentation

License

MIT

Project details


Download files

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

Source Distribution

bidiwave-1.0.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

bidiwave-1.0.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file bidiwave-1.0.0.tar.gz.

File metadata

  • Download URL: bidiwave-1.0.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bidiwave-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f4db4f2a80eeb986af8be94bafc07e515842ba8b2239fb797fe2e05cc7790c7c
MD5 904f71b62bee96f6c3162c673c70c49d
BLAKE2b-256 783bfb09c0fa8b6e07eeb34bbaa8eb5866547a3d0ee2f5b4d8fdd99af79bd97b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bidiwave-1.0.0.tar.gz:

Publisher: release.yml on MathiasPaulenko/bidiwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bidiwave-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bidiwave-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bidiwave-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 193c403cdf44f0f5d64e12b105ca3ab378474c49654e8d11fa91f4b2c7ab55a5
MD5 2ea3e9b98ff18d848b1ccefd11a6c7c9
BLAKE2b-256 6b6420ae2bcf44543ab2880d22794076c7a7bb5ad8f056001d60a9ec5e60f57a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bidiwave-1.0.0-py3-none-any.whl:

Publisher: release.yml on MathiasPaulenko/bidiwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page