Chrome DevTools Protocol for Python — direct CDP over WebSocket, no Selenium, no Playwright
Project description
cdpwave
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 typed —
mypy --strictacross 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 hatch —
session.send("Any.CDPMethod", params)for any uncovered command - HTTP discovery — typed access to
/json/versionand/json/listendpoints - WebSocket keepalive — automatic ping/pong with configurable interval and timeout
- Direct WebSocket URL —
CDPClient.connect(ws_url=...)bypasses HTTP discovery - Event helpers —
session.wait_for_event()andsession.on()for async event handling - Multi-tab sessions —
client.sessionsproperty 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.
- Quickstart — 10-minute tutorial
- Guide — in-depth feature coverage
- Cookbook — common recipes
- API Reference — auto-generated docs
- Migration — from pyppeteer or pychrome
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdpwave-2.5.0.tar.gz.
File metadata
- Download URL: cdpwave-2.5.0.tar.gz
- Upload date:
- Size: 218.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86c84ab937be6ed4e11a476032eb23009b9a55fb75889763b9910b8d8e9ddfca
|
|
| MD5 |
2faf44e0c8c0c1ab197fbeed5c9f1770
|
|
| BLAKE2b-256 |
7764f6e4ceebe7ac9beca7c3dbb49a7ba1e98ddd552669fc46c44dccd00d236c
|
Provenance
The following attestation bundles were made for cdpwave-2.5.0.tar.gz:
Publisher:
release.yml on MathiasPaulenko/cdpwave
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cdpwave-2.5.0.tar.gz -
Subject digest:
86c84ab937be6ed4e11a476032eb23009b9a55fb75889763b9910b8d8e9ddfca - Sigstore transparency entry: 2128752473
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/cdpwave@5cbfe0c4c4c06040890f55b049f177509a53ed1e -
Branch / Tag:
refs/tags/v2.5.0 - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5cbfe0c4c4c06040890f55b049f177509a53ed1e -
Trigger Event:
push
-
Statement type:
File details
Details for the file cdpwave-2.5.0-py3-none-any.whl.
File metadata
- Download URL: cdpwave-2.5.0-py3-none-any.whl
- Upload date:
- Size: 92.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d271a17ae964a2bc4dc47653dadb725bc517b853aeeb7aefdfc2bd49977a69be
|
|
| MD5 |
babd95a92c25e1f9df829811a3e4a8da
|
|
| BLAKE2b-256 |
b9e528b26aaa40a23b8b0b275e45145c9be25ebb02606cb58d9d4ac1804420ff
|
Provenance
The following attestation bundles were made for cdpwave-2.5.0-py3-none-any.whl:
Publisher:
release.yml on MathiasPaulenko/cdpwave
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cdpwave-2.5.0-py3-none-any.whl -
Subject digest:
d271a17ae964a2bc4dc47653dadb725bc517b853aeeb7aefdfc2bd49977a69be - Sigstore transparency entry: 2128752523
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/cdpwave@5cbfe0c4c4c06040890f55b049f177509a53ed1e -
Branch / Tag:
refs/tags/v2.5.0 - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5cbfe0c4c4c06040890f55b049f177509a53ed1e -
Trigger Event:
push
-
Statement type: