# Pydoll

> Drive Chrome over CDP with no WebDriver and humanized interactions

- Category: Data & Labeling / Web Scraping & Crawling
- Language: Python
- Licence: MIT
- Repository: https://github.com/autoscrape-labs/pydoll
- Website: https://pydoll.tech/
- Canonical page: https://ai-tldr.dev/tools/pydoll/

## In short

Pydoll is a stealth-first browser automation library for Python. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Python and licensed MIT. To get started: install Pydoll.

## Overview

Pydoll is a stealth-first browser automation library for Python. It drives Chromium directly over the Chrome DevTools Protocol on a WebSocket connection, so there is no WebDriver binary to install, no version matching to keep up with, and no `navigator.webdriver` flag for anti-bot scripts to read.

The problem it targets is the gap between a scraper that works on your laptop and one that runs for real. Pydoll moves the mouse along Bezier curves, types with realistic timing and applies scroll physics, which the project notes is often enough to clear behavioural challenges such as Cloudflare Turnstile or reCAPTCHA v3 — with the caveat that outcomes depend on your browser and IP reputation.

Beyond evasion it is a full automation toolkit: `tab.apply_fingerprint()` aligns User-Agent, Client Hints, `navigator`, WebGL, canvas, screen, fonts, timezone and locale into one consistent identity that survives `toString` and prototype introspection and propagates into Web Workers; request interception can block trackers or discover APIs; and `tab.extract()` returns typed, validated data against a Pydantic model instead of manual element-by-element querying. The API is async and type-checked with mypy. Note that the maintainer has posted that the project is currently maintained by one person and moving at a calmer pace.

## What it does

- Direct CDP connection over WebSocket — no WebDriver binary and no `navigator.webdriver` flag
- Humanized interactions: Bezier-curve mouse movement, realistic typing and scroll physics
- Fingerprint injection aligning User-Agent, Client Hints, navigator, WebGL, canvas, screen, fonts, timezone and locale
- Network control: intercept requests, monitor traffic, and make authenticated HTTP requests that inherit the browser session
- Full shadow DOM (including closed roots) and cross-origin iframe support through the same API
- Structured extraction with `tab.extract()` against a Pydantic model, returning typed and validated data

## Getting started

Pydoll installs as a single pip package with no external binaries. The API is asyncio-based, so entry points run under `asyncio.run`.

1. Install Pydoll

   Requires Python 3.10 or newer. No WebDriver binaries or external dependencies.

```bash
pip install pydoll-python
```

2. Start a browser and interact

   Open a tab, find elements and act on them. Pass `humanize=True` to add human-like timing to typing and clicks.

```python
import asyncio

from pydoll.browser import Chrome
from pydoll.constants import Key

async def google_search(query: str):
    async with Chrome() as browser:
        tab = await browser.start()
        await browser.set_window_maximized()
        await tab.go_to('https://www.google.com')
        search_box = await tab.find(tag_name='textarea', name='q')
        await search_box.type_text(query, humanize=True)
        await tab.keyboard.press(Key.ENTER)

        first_result = await tab.find(
            tag_name='h3',
            text='autoscrape-labs/pydoll',
            timeout=10,
        )
        await first_result.click(humanize=True)
        print(f"Page loaded: {await tab.title}")

asyncio.run(google_search('pydoll site:github.com'))
```

3. Make the browser report a consistent identity

   `tab.apply_fingerprint()` overrides the surfaces fingerprinting scripts read, keeping them mutually consistent rather than leaking a mismatched profile.

```python
await tab.apply_fingerprint()
```

4. Read the guides for the advanced surfaces

   The documentation at pydoll.tech covers mouse behaviour, request interception, network monitoring, authenticated HTTP requests, DOM traversal into shadow roots, and structured extraction with Pydantic models.

## When to use it

- Scrape a site that blocks ordinary Selenium or Playwright automation with bot-protection challenges
- Collect training or evaluation data from pages that require realistic interaction to render
- Discover a site's private API by monitoring network traffic while you drive the page
- Run end-to-end browser tests without maintaining a matching WebDriver binary per Chrome version
