How it works
nodriver’s core design makes it undetectable:- Uses a clean, unpatched Chrome browser
- No automation signatures in the browser fingerprint
- Natural mouse movements and interactions
- Proper timing and behavior patterns
Basic example
Simply navigate to a CloudFlare-protected site:In most cases, CloudFlare protection is bypassed automatically. You don’t need to write any special code - just navigate to the URL normally.
Handling verification checkboxes
For sites with interactive verification (like “I’m not a robot” checkboxes), use theverify_cf() method:
Multi-tab CloudFlare example
You can handle multiple CloudFlare-protected sites simultaneously:Using template matching for custom challenges
For custom verification UIs, you can use template matching to find and click verification elements:Key methods
verify_cf()
Automatically finds and clicks CloudFlare verification checkboxes:The
verify_cf() method uses computer vision to locate verification checkboxes that are hidden from the DOM using shadow-root or web workers.Template image format
If you need to create a custom template image:- Take a screenshot of the verification element
- Crop it to include the target area
- Ensure the target is in the center of the image
- Use a moderate size (e.g., 111x71 pixels)
- Include some surrounding context for better matching
1
Navigate to protected site
Simply use
get() as you normally would:2
Wait for page load
Let the page fully load and CloudFlare checks complete:This is usually all you need. CloudFlare will pass automatically.
3
Handle verification if needed
Only if there’s an interactive challenge:
4
Continue normally
After verification, use the page as normal:
Best practices
Add realistic delays
Mimic human behavior with natural pauses:Avoid detection patterns
Handle dynamic content
Advanced: Accessing bot challenge pages
Some sites may still present challenges. Here’s how to handle them:Troubleshooting
If you’re still being blocked:- Add more realistic delays: Humans don’t interact instantly
- Use headless mode carefully: Some sites detect headless browsers
- Check your IP: You might be rate-limited or blocked at the network level
- Rotate user agents: Though nodriver handles this, you can customize if needed
- Check for captchas: Some sites use captchas that require human solving
nodriver is designed to be undetectable, but it’s not a magic bullet. Some advanced bot protection systems may still detect automation through behavioral analysis or require human intervention (like captchas).