What is Crawlee for Python?
Crawlee for Python is the Python version of the Crawlee library from Apify. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Python. To get started: install Crawlee.
Overview
Crawlee for Python is the Python version of the Crawlee library from Apify. It handles crawling and scraping end-to-end: following links, extracting data, and storing it in machine-readable formats, so you can focus on what data you want instead of the plumbing around it.
It is aimed at Python developers who need to collect web data at scale, including data for AI, LLMs, and RAG pipelines. It offers both an HTTP-based crawler that parses HTML with BeautifulSoup and a Playwright-based crawler for sites that need client-side JavaScript, with default settings tuned so crawlers blend in and avoid common bot protections.
Within the web scraping and crawling space, Crawlee sits as a full framework rather than a single-purpose tool. It manages the request queue, link enqueuing, retries, and persistent storage for you, and exposes rich configuration when the defaults are not enough. A TypeScript implementation is also available for JavaScript projects.
What it does
- Two crawler types: BeautifulSoupCrawler for fast HTTP-based HTML scraping, and PlaywrightCrawler for JavaScript-heavy sites
- Default configuration makes crawlers appear human-like to reduce blocking by modern bot protections
- Built-in link enqueuing with context.enqueue_links() to crawl a site by following discovered links
- Persistent storage via context.push_data() that writes scraped data to a local storage/ directory
- Crawlee CLI with ready-made project templates to scaffold a new crawler quickly
- Modular install: a small core package plus optional extras like beautifulsoup and all to keep dependencies minimal
Getting started
Crawlee is published on PyPI as the crawlee package. Install it, set up Playwright, then run a minimal crawler.
Install Crawlee
Install the package with all features, then install the Playwright browser dependencies.
python -m pip install 'crawlee[all]'
playwright installVerify the installation
Confirm Crawlee is importable and print its version.
python -c 'import crawlee; print(crawlee.__version__)'Scaffold a project with the CLI (optional)
The quickest start is the Crawlee CLI, which offers prepared templates. It requires uv.
uvx 'crawlee[cli]' create my-crawlerWrite a minimal crawler
This BeautifulSoupCrawler fetches pages over HTTP, extracts the title, stores the data, and follows links. A run creates a storage/ directory in your working directory.
import asyncio
from crawlee.crawlers import BeautifulSoupCrawler, BeautifulSoupCrawlingContext
async def main() -> None:
crawler = BeautifulSoupCrawler(
# Limit the crawl to max requests. Remove or increase it for crawling all links.
max_requests_per_crawl=10,
)
# Define the default request handler, which will be called for every request.
@crawler.router.default_handler
async def request_handler(context: BeautifulSoupCrawlingContext) -> None:
context.log.info(f'Processing {context.request.url} ...')
# Extract data from the page.
data = {
'url': context.request.url,
'title': context.soup.title.string if context.soup.title else None,
}
# Push the extracted data to the default dataset.
await context.push_data(data)
# Enqueue all links found on the page.
await context.enqueue_links()
# Run the crawler with the initial list of URLs.
await crawler.run(['https://crawlee.dev'])
if __name__ == '__main__':
asyncio.run(main())Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Collecting web data to feed AI, LLM, and RAG pipelines
- Scraping structured data from static HTML pages at scale using the HTTP-based BeautifulSoupCrawler
- Crawling JavaScript-heavy sites that need a real browser via the PlaywrightCrawler
- Building a site crawler that follows links and persists results to local storage for later processing
How Crawlee for Python compares
Crawlee for Python alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Firecrawl | ★ 214k | A crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs. |
| Agent Reach | ★ 116k | A capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees. |
| Scrapling | ★ 107k | A Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls. |
| Crawl4AI | ★ 88.2k | A local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines. |
| Scrapy | ★ 65.7k | A mature Python framework for writing fast spiders that crawl websites and extract structured data at scale. |
| changedetection.io | ★ 36.1k | A self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise. |
| ScrapeGraphAI | ★ 33k | A Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts. |
| Crawlee for Python | ★ 9.7k | A Python web scraping and browser automation library for building reliable crawlers |

