Skip to main content
Nodriver is built on top of the Chrome DevTools Protocol (CDP), giving you direct access to powerful low-level browser controls. This guide covers advanced CDP usage for custom automation scenarios.

Understanding CDP

The Chrome DevTools Protocol is the same protocol used by Chrome DevTools. It provides domains like Page, Network, DOM, Runtime, and many more. Nodriver exposes CDP through the cdp module:
From tab.py:44-62:
So tab.send() accepts a generator object, which is created by calling a cdp method. This way you can build very detailed and customized commands.

Evaluating JavaScript

Network monitoring

Listening to network events

From network_monitor.py example:

Intercepting requests

Modifying requests

DOM manipulation

Direct DOM access

Getting computed styles

Performance monitoring

Enable performance metrics

Page load timing

Emulation

Device emulation

Touch emulation

Network throttling

Console monitoring

Listen to console messages

Exception monitoring

Security

Certificate error handling

Override security headers

Advanced scripting

Add scripts on new documents

Call function on remote object

Downloads

Handle downloads

Real-world example: Advanced monitoring

Best practices