Skip to main content

Chrome DevTools Protocol for Python — direct CDP over WebSocket, no Selenium, no Playwright

Project description

cdpwave

CI Tests Docs Release PyPI Python License: MIT

Chrome DevTools Protocol for Python — direct, typed, async.

cdpwave talks to Chrome over a raw WebSocket. No Node.js, no ChromeDriver, no browser downloads. Just pure Python with full type hints and async-first design.

Why cdpwave?

  • Full CDP coverage — all 48 CDP domains implemented with 386 typed methods
  • Direct WebSocket — single connection to Chrome's DevTools Protocol, no intermediate layers
  • Fully typedmypy --strict across the entire codebase, IDE autocomplete everywhere
  • Async-first — built on asyncio, no threading, no blocking calls
  • Browser detection — finds Chrome, Edge, Brave, or Chromium already on your system
  • Flatten sessions — one WebSocket for all tabs via Target.attachToTarget + sessionId
  • Escape hatchsession.send("Any.CDPMethod", params) for any uncovered command
  • HTTP discovery — typed access to /json/version and /json/list endpoints
  • WebSocket keepalive — automatic ping/pong with configurable interval and timeout
  • Direct WebSocket URLCDPClient.connect(ws_url=...) bypasses HTTP discovery
  • Event helperssession.wait_for_event() and session.on() for async event handling
  • Multi-tab sessionsclient.sessions property tracks all active sessions
  • MIT licensed — permissive, compatible with any use

Install

pip install cdpwave

Quick start

import asyncio
from cdpwave import CDPClient

async def main() -> None:
    async with await CDPClient.launch(headless=True) as client:
        session = await client.new_page("https://example.com")
        result = await session.runtime.evaluate("document.title", return_by_value=True)
        print(result["result"]["value"])  # "Example Domain"
        await session.close()

asyncio.run(main())

Documentation

Full documentation at mathiaspaulenko.github.io/cdpwave.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines on development setup, code style, testing, and pull request process.

Please read our Code of Conduct before participating.

Security

Found a vulnerability? See SECURITY.md for responsible disclosure.

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

cdpwave-2.4.0.tar.gz (216.6 kB view details)

Uploaded Source

Built Distribution

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

cdpwave-2.4.0-py3-none-any.whl (92.3 kB view details)

Uploaded Python 3

File details

Details for the file cdpwave-2.4.0.tar.gz.

File metadata

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

File hashes

Hashes for cdpwave-2.4.0.tar.gz
Algorithm Hash digest
SHA256 6c06c109e35a7add70b36c4eb6d199c4617f9a867db0741a472e404bcb784045
MD5 ae4861b1a0ac9193521ee65c0a9b03ad
BLAKE2b-256 50d51d1f10bfb84d6401d4c1d08d1f06bb4fb834c8dae627a3da64218820c31b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdpwave-2.4.0.tar.gz:

Publisher: release.yml on MathiasPaulenko/cdpwave

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

File details

Details for the file cdpwave-2.4.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cdpwave-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51d47ddfa1384aabbc46f42d0a74fc84e34db6bee1548fe452e0c1f103a1ccbb
MD5 cd9572b415d95a9a627a88d3088e67bc
BLAKE2b-256 a732f8e1a21b553e9d6ea195df68ccdfd9a68ea604fc7879f0877d5d22d9b8f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdpwave-2.4.0-py3-none-any.whl:

Publisher: release.yml on MathiasPaulenko/cdpwave

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