Skip to main content
nodriver is built to be undetectable by bot protection systems like CloudFlare. This example shows you how to access CloudFlare-protected sites and handle verification challenges.

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
Most CloudFlare-protected sites will work automatically without any special code.

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 the verify_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:
  1. Take a screenshot of the verification element
  2. Crop it to include the target area
  3. Ensure the target is in the center of the image
  4. Use a moderate size (e.g., 111x71 pixels)
  5. 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

While nodriver is very effective at bypassing bot detection, always:
  • Respect robots.txt and terms of service
  • Add reasonable delays between requests
  • Don’t hammer servers with rapid requests
  • Consider the ethical and legal implications of your automation

Advanced: Accessing bot challenge pages

Some sites may still present challenges. Here’s how to handle them:

Troubleshooting

If you’re still being blocked:
  1. Add more realistic delays: Humans don’t interact instantly
  2. Use headless mode carefully: Some sites detect headless browsers
  3. Check your IP: You might be rate-limited or blocked at the network level
  4. Rotate user agents: Though nodriver handles this, you can customize if needed
  5. 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).