Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank

Previous survey · No. 807 ·

Pricing
Open Source
Type
TOOL
GitHub
318 stars
Date

About

Type-safe Python wrapper for the Chrome DevTools Protocol — programmatically drive Chromium browsers.

What it does

It turns official Chrome debugging specifications into an asynchronous Python client organized by browser capability. Applications connect through a supplied WebSocket endpoint, send structured commands, receive typed results, and register typed handlers for browser events.

Why it's ranked here

The appeal is specific: broad protocol coverage without giving up editor guidance or static checking. Generated domain modules keep a huge browser interface navigable, while one asynchronous client handles requests and events. The rough edge is distribution: regeneration tooling is excluded from the built package.

What's good

Parameters, results, and individual event payloads receive explicit Python types, including optional fields and literal values. Domain separation makes capabilities such as navigation, networking, accessibility, storage, and tracing easier to discover. The client also supports concurrent requests, session identifiers, custom connection headers, and configurable WebSocket frame limits.

Tradeoffs

You must supply a reachable Chrome DevTools WebSocket endpoint, so browser startup and debugging configuration remain your responsibility. The runtime requires Python 3.11 or newer. Regeneration downloads pinned protocol files, deletes the generated output directory, and depends on Ruff for formatting. The packaged distribution excludes the generator itself.

How to use it well

Choose it for typed, asynchronous Python systems that need direct access to many Chrome debugging domains or event streams. Generate and commit bindings when developing from the repository, then pin them to the Chromium revision you target. Pair it with separate browser launch and lifecycle tooling, because this client starts from an existing debugging endpoint.

Technical notes+

cdp_use/client.py implements the asyncio WebSocket transport, request correlation, session-aware messaging, event dispatch, custom headers, and a default 100 MB frame limit. cdp_use/generator/generate.py downloads pinned browser and JavaScript protocol JSON, adds JSON files from cdp_use/custom_protocols/, and invokes CDPGenerator. cdp_use/generator/generator.py recreates cdp_use/cdp, emits per-domain types, commands, events, clients, and registration interfaces, then runs Ruff. cdp_use/generator/type_generator.py maps protocol objects to TypedDict, enums to Literal, and cross-domain references to imports guarded by TYPE_CHECKING. cdp_use/cdp/registry.py stores one callback per event method and accepts synchronous or awaitable handlers. pyproject.toml uses Hatchling, includes cdp_use/**/*.py plus cdp_use/py.typed, and explicitly excludes cdp_use/generator/*.py from builds.

Observed

License
MIT
Primary language
Python
Python requirement
Python 3.11 or newer
Interface
Asynchronous Python library over a Chrome DevTools WebSocket connection
Build system
Hatchling with the hatchling.build backend
Runtime dependencies
httpx, idna, typing-extensions, and websockets
Platform support
Declared operating-system independent
Package structure
Generated domain modules are included, while generator Python files are excluded from built distributions

Read from README.md, pyproject.toml, simple.py, cdp_use/client.py, cdp_use/__init__.py, cdp_use/cdp/library.py, cdp_use/cdp/__init__.py, cdp_use/cdp/registry.py, cdp_use/generator/__init__.py, cdp_use/generator/__main__.py, cdp_use/generator/generate.py, cdp_use/generator/constants.py, cdp_use/generator/generator.py, cdp_use/cdp/registration_library.py, cdp_use/generator/type_generator.py.

What it can do

  • Automate web browser navigation

    Navigation commands and target URLsBrowser state changes and page loads

  • Execute JavaScript in browser context

    JavaScript code stringsExecution results and return values

  • Capture screenshots of web pages

    Page elements or viewport specificationsImage files or binary data

  • Extract DOM elements and content

    CSS selectors or XPath expressionsHTML elements and text content

  • Monitor network requests and responses

    Network event listeners and filtersHTTP request/response data and metadata

  • Simulate user interactions

    Click coordinates, keyboard input, and form dataTriggered events and page state changes

  • Generate PDF from web pages

    Page URLs and PDF generation optionsPDF documents

Tags

cdpchromebrowserpythonautomation

Tech Stack

Python

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.