Crawlee is a Python library for web scraping and browser automation, providing a robust and flexible framework for building web scraping tasks. It offers features like automatic parallel crawling, proxy rotation, session management, and persistent storage, supporting various techniques from static HTML parsing with BeautifulSoup and Parsel to dynamic JavaScript-rendered content with Playwright. Currently at version 1.6.2, Crawlee for Python has been stable since its v1.0 release in September 2025 and follows semantic versioning, meaning breaking changes are reserved for major releases.
pip install crawleeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `PlaywrightCrawler` to recursively crawl a website, extract the page title and content length, and store the results. It highlights the asynchronous nature of Crawlee, defining a request handler, enqueuing new links, and exporting collected data. Remember to install browser binaries separately with `playwright install` if using PlaywrightCrawler.
Review the 'Upgrading to v1' guide in the official documentation. Update imports for storage clients and HTTP clients. Ensure all I/O operations (like `HttpResponse.read()`) are awaited. Adjust code relying on old `Request` object properties.
Update class names (e.g., `BaseStorageClient` to `StorageClient`). Adjust crawler option instantiation. Adapt cookie handling to the new `SessionCookies` object. If custom browser context behavior is needed for Playwright, configure `user_data_dir` or explicitly manage contexts.
After installing `crawlee[playwright]`, run `playwright install` in your environment. If using specific browser types (e.g., Firefox, Webkit), you might need `playwright install firefox` or `playwright install webkit`.
Ensure all calls to asynchronous Crawlee methods are prefixed with `await` and executed within an `async def` function, which is then run using `asyncio.run()`.
Install with specific extras (e.g., `pip install 'crawlee[beautifulsoup]'`) or all extras (`pip install 'crawlee[all]'`) depending on your needs.