# AI use cases for Crawlee Python (apify/crawlee-python)

Repo: [apify/crawlee-python](https://github.com/apify/crawlee-python) | Use cases: 3 | Page: https://dedupedai.com/use-cases/apify-crawlee-python/

Crawlee for Python is Apify's web scraping and browser automation library. One interface covers HTTP crawling with BeautifulSoup and headless browser crawling with Playwright, with automatic parallel crawling, retries, proxy rotation, a persistent URL queue, pluggable storage and state persistence. A CLI scaffolds new crawlers from templates.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Scaffold a new crawler from a template: https://dedupedai.com/use-cases/apify-crawlee-python/scaffold-a-crawler-with-the-crawlee-cli/
- Crawl a site and save each page title: https://dedupedai.com/use-cases/apify-crawlee-python/crawl-a-site-and-save-titles-with-crawlee/
- Scrape JavaScript-heavy pages with a headless browser: https://dedupedai.com/use-cases/apify-crawlee-python/scrape-javascript-pages-with-crawlee-playwright/

## How to scaffold a new crawler from a template with Crawlee Python

Repo: [apify/crawlee-python](https://github.com/apify/crawlee-python) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Use the Crawlee CLI to generate a ready-to-run project.

**Who it is for:** A developer starting a scraping project.

**The problem:** Setting up queues, storage and retries by hand takes time.

**The outcome:** A crawler project named my-crawler ready to edit.

### Steps

1. Check uv is installed with `uv --help`
2. Run `uvx 'crawlee[cli]' create my-crawler` and choose a template
3. If Crawlee is already installed, run `crawlee create my-crawler` instead
4. Open the project and set your start URLs

### Prompt to paste into your agent

```text
Using apify/crawlee-python, run `uvx 'crawlee[cli]' create my-crawler`, pick the BeautifulSoup template, and adapt it to collect page titles from <my site>.
```

### Caveat

This card is written from the apify/crawlee-python README, not from a test run by Deduped. Before you start, make sure you have Python with pip, or uv for the CLI. Check the repo for newer instructions before you rely on these steps.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/apify-crawlee-python/scaffold-a-crawler-with-the-crawlee-cli/

## How to crawl a site and save each page title with Crawlee Python

Repo: [apify/crawlee-python](https://github.com/apify/crawlee-python) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Use BeautifulSoupCrawler to follow links and push URL and title for each page into a dataset.

**Who it is for:** An analyst building a site inventory or content audit.

**The problem:** Writing link following, dedup and storage yourself is error prone.

**The outcome:** A dataset with URL and title for every crawled page.

### Steps

1. Install with `python -m pip install 'crawlee[all]'`
2. Copy the BeautifulSoupCrawler example and set max_requests_per_crawl
3. In the handler, push url and title with context.push_data and call context.enqueue_links()
4. Run crawler.run with your start URL

### Prompt to paste into your agent

```text
With apify/crawlee-python, install `python -m pip install 'crawlee[all]'`, write a BeautifulSoupCrawler that crawls up to 200 pages of <my own site>, stores URL and title, and exports the dataset to CSV.
```

### Caveat

This card is written from the apify/crawlee-python README, not from a test run by Deduped. Before you start, make sure you have Python with pip, or uv for the CLI. Check the repo for newer instructions before you rely on these steps.

Risk, data: Only crawl sites you are allowed to; keep request limits polite.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/apify-crawlee-python/crawl-a-site-and-save-titles-with-crawlee/

## How to scrape JavaScript-heavy pages with a headless browser with Crawlee Python

Repo: [apify/crawlee-python](https://github.com/apify/crawlee-python) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use PlaywrightCrawler for pages that only render content in the browser.

**Who it is for:** A developer extracting data from a dynamic web app.

**The problem:** Plain HTTP fetches miss content rendered by JavaScript.

**The outcome:** Extracted data from fully rendered pages.

### Steps

1. Install with `python -m pip install 'crawlee[all]'`
2. Install browsers with `playwright install`
3. Copy the PlaywrightCrawler example and read data with context.page
4. Run it and check the stored results

### Prompt to paste into your agent

```text
Using apify/crawlee-python, run `playwright install`, then write a PlaywrightCrawler that opens <my dashboard URL list>, reads the rendered page title and one table, and saves them with push_data.
```

### Caveat

This card is written from the apify/crawlee-python README, not from a test run by Deduped. Before you start, make sure you have Python with pip, or uv for the CLI. Check the repo for newer instructions before you rely on these steps.

Risk, data: Follow the target site's terms of service; do not use it to get around access controls.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/apify-crawlee-python/scrape-javascript-pages-with-crawlee-playwright/
