Nodriver is specifically designed to be undetectable by anti-bot systems. Unlike other browser automation tools, it operates with built-in stealth features that make it indistinguishable from a regular Chrome browser.
How nodriver avoids detection
Nodriver works differently from traditional automation tools like Selenium:
Automatic stealth features
Nodriver applies stealth techniques automatically when you use headless=True:
From tab.py:203-222:
User agent cleaning
Nodriver automatically removes the “Headless” string from the user agent when running in headless mode.
Running in headless mode
Headless mode allows you to run without a visible browser window:
Even in headless mode, nodriver removes detection indicators automatically.
Expert mode for advanced stealth
Use expert mode for additional anti-detection features:
From config.py:68-70:
From tab.py:224-241:
Expert mode:
- Disables site isolation trials
- Forces shadow DOM to always be in “open” mode
- Adds debugging capabilities
Custom user agent
Override the user agent if needed:
Realistic timing and behavior
Make your automation more human-like:
Using custom Chrome profile
Use a real user profile to maintain cookies and browsing history:
Don’t use your main Chrome profile while Chrome is running. Create a separate profile for automation.
Handling CAPTCHAs
Nodriver can often bypass bot detection that triggers CAPTCHAs:
Dealing with Cloudflare
Nodriver often passes Cloudflare checks automatically:
Fingerprint resistance
Canvas fingerprinting
Add noise to canvas fingerprinting:
WebGL fingerprinting
Obfuscate WebGL parameters:
Proxy usage for IP rotation
Use browser contexts with different proxies:
Best practices for stealth
Real-world example
Here’s a complete stealth automation example:
Testing detection
Verify that your automation is undetectable:
Run the test detection script periodically to ensure your automation remains undetectable as anti-bot systems evolve.