This package is a fork of the
ultrafunkamsterdam/nodriver
, created to add new features, compile unmerged bugfixes, and increase community engagement.
Documentation: https://slensky.com/zendriver
Zendriver is a blazing fast, async-first, undetectable webscraping/web automation framework implemented using the Chrome Devtools Protocol. Visit websites, scrape content, and run JavaScript using a real browser (no Selenium/Webdriver) all with just a few lines of Python.
Docker support is here! Check out stephanlensky/zendriver-docker
for an example of how to run Zendriver with a real, GPU-accelerated browser (not headless) in a Docker container. (Linux-only)
timeout
until found. Single element lookup by text using tab.find()
accepts a best_match flag
, which will not naively return the first match, but will match candidates by closest matching text length.repr
for elements, which represents the element as HTML, makes debugging much easier.To install, simply use pip
(or your favorite package manager):
pip install zendriver
# or uv add zendriver, poetry add zendriver, etc.
Example for visiting https://www.browserscan.net/bot-detection and saving a screenshot of the results:
import asyncio
import zendriver as zd
async def main():
browser = await zd.start()
page = await browser.get("https://www.browserscan.net/bot-detection")
await page.save_screenshot("browserscan.png")
await browser.stop()
if __name__ == "__main__":
asyncio.run(main())
Check out the Quickstart for more information and examples.
Zendriver remains committed to nodriver
's goals of staying undetected for all modern anti-bot solutions and also keeps with the batteries-included approach of its predecessor. Unfortunately, contributions to the original nodriver
repo are heavily restricted, making it difficult to submit issues or pull requests. At the time of writing, there are several pull requests open to fix critical bugs which have beeen left unaddressed for many months.
Zendriver aims to change this by:
nodriver
repo as part of the initial releaseruff
and mypy
, reducing the number of easy-to-catch bugs which make it through in the futureWith these changes in place, we hope to further development of state-of-the-art open-source web automation tools even further, helping to once again make the web truly open for all.
Contributions of all types are always welcome! Please see CONTRIBUTING.md for details on how to contribute.
If you have a question, bug report, or want to make a general inquiry about the project, please create a new GitHub issue. If you are having a problem with Zendriver, please make sure to include your operating system, Chrome version, code example demonstrating the issue, and any other information that may be relevant.
Questions directed to any personal accounts outside of GitHub will be ignored.