apify/crawlee-python
Crawlee—A web scraping and browser automation library for Python to build reliable crawlers. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Parsel, BeautifulSoup, Playwright, and raw HTTP. Both headful and headless mode. With proxy rotation.
What it solves
Crawlee for Python is a web scraping and browser automation library designed to build reliable, high-performance scrapers that can bypass modern bot protections and operate in a human-like manner. It simplifies the process of crawling links, extracting data, and storing it in machine-readable formats without requiring the developer to handle the technical complexities of request management and bot detection.
How it works
Crawlee provides a unified interface for both HTTP-based crawling and headless browser automation. It offers two primary crawler types:
- BeautifulSoupCrawler: An efficient, browser-less crawler that uses an HTTP library and BeautifulSoup for parsing HTML, ideal for static content.
- PlaywrightCrawler: A headless browser-based crawler built on Playwright, used for sites that require JavaScript execution or user interaction.
The library manages parallel crawling based on system resources, handles automatic retries, rotates proxies, and uses a persistent queue for URLs to ensure that scraping pipelines can resume from interruptions.
Who it’s for
It is intended for developers who need to extract data from the web at scale, specifically those who prefer modern Python (3.10+) and asynchronous programming (Asyncio) over traditional frameworks like Scrapy.
Highlights
- Unified Interface: Supports both HTTP and headless browser crawling in one library.
- Asyncio-based: Built on Python's standard asynchronous library for high performance.
- Bot Protection Bypass: Default configurations help crawlers appear human-like to avoid detection.
- State Persistence: Saves progress during interruptions to avoid restarting from scratch.
- Integrated Tooling: Includes proxy rotation, session management, and pluggable storage for tabular data and files.
Related
- Project
- Project
- Project
- Project
- Project