Skip to content

nodrivervssplash

AGPL-3.0 14 2 4,003
321.9 thousand (month) Jan 15 2024 0.48.1(2025-11-09 05:57:23 ago)
4,193 15 399 BSD-3-Clause
Apr 25 2014 446 (month) 3.5(2020-06-16 13:27:02 ago)

nodriver is a Python library for browser automation that communicates directly with the browser via the Chrome DevTools Protocol (CDP), without relying on Selenium or chromedriver. It is the successor to undetected-chromedriver, created by the same author, and is designed from the ground up to be undetectable by anti-bot systems.

Key advantages over traditional browser automation:

  • No chromedriver dependency Communicates directly with Chrome/Chromium via CDP websocket, eliminating the most common detection vector (chromedriver fingerprint).
  • Undetectable by default Does not set the navigator.webdriver flag, does not inject automation-related JavaScript, and avoids CDP detection patterns that anti-bot systems look for.
  • Fast and lightweight Without the Selenium/WebDriver protocol overhead, nodriver is significantly faster at launching browsers and executing commands.
  • Async-first Built entirely on Python's asyncio, enabling efficient concurrent browser automation.
  • Simple API Clean, Pythonic API that is easier to use than raw CDP or Selenium.

nodriver is particularly useful for scraping websites protected by advanced anti-bot systems like Cloudflare, DataDome, or PerimeterX, where standard Selenium or Playwright setups get detected and blocked.

Splash is a javascript rendering service with an HTTP API. It's a lightweight browser with an HTTP API, implemented in Python 3 using Twisted and QT5.

It is built on top of the QtWebkit library and allows developers to interact with web pages in a headless mode, which means that the web pages are rendered in the background, without displaying them on the screen.

splash is particularly useful for web scraping and web testing tasks, as it allows developers to interact with web pages in a way that is very similar to how a human user would interact with the browser.

It also allows you to execute javascript and interact with web pages even if they use heavy javascript.

Unlike Selenium or Playwright, splash is powered by webkit embedded browser instead of a real browser like Chrome or Firefox. As a down-side splash requests are easy to detect and block when scraping websites with anti-scraping features.

One benefit of splash is that it seemlesly integrates with Scrapy.

Highlights


anti-detectcdpasyncfast

Example Use


```python import nodriver as uc import asyncio async def main(): # Launch browser - undetected by default browser = await uc.start() # Open a new tab and navigate tab = await browser.get("https://example.com") # Wait for an element and interact with it search_box = await tab.find("input[name='q']") await search_box.send_keys("web scraping") # Click a button button = await tab.find("button[type='submit']") await button.click() # Wait for navigation and extract content await tab.wait_for("div.results") results = await tab.query_selector_all("div.result") for result in results: title = await result.query_selector("h3") print(await title.get_text()) # Take a screenshot await tab.save_screenshot("results.png") browser.stop() asyncio.run(main()) ```
```python # once splash server is started it can be requested to render pages through # HTTP requests: import requests url = "http://localhost:8050/render.html" payload = { 'url': 'https://www.example.com', 'timeout': 30, 'wait': 2 } response = requests.get(url, params=payload) # Get the page HTML print(response.text) ```

Alternatives / Similar


Was this page helpful?