Web scraping code templates

Actor templates help you quickly set up your web scraping projects, saving you development time and giving you immediate access to all the features the Apify platform has to offer.

TypeScript templates

typescript iconbeeai icon

🐝 BeeAI agent

Example of how to use Bee Agent Framework with Apify Actors to create a social media analysis agent.

AI Agent

typescript iconmastraai icon

Mastra agent

Example of how to use Mastra with Apify Actors to create a social media analysis agent.

AI Agent

typescript iconnodejs iconcheerio iconaxios icon

Start with TypeScript

Scrape single page with provided URL with Axios and extract data from page's HTML with Cheerio.

Starter

typescript iconnodejs iconcrawlee iconcheerio icon

Crawlee + Cheerio

A scraper example that uses Cheerio to parse HTML. It's fast, but it can't run the website's JavaScript or pass JS anti-scraping challenges.

typescript iconnodejs iconcrawlee iconpuppeteer iconchrome icon

Crawlee + Puppeteer + Chrome

Example of a Puppeteer and headless Chrome web scraper. Headless browsers render JavaScript and are harder to block, but they're slower than plain HTTP.

typescript iconnodejs iconcrawlee iconplaywright iconchrome icon

Crawlee + Playwright + Chrome

Web scraper example with Crawlee, Playwright and headless Chrome. Playwright is more modern, user-friendly and harder to block than Puppeteer.

typescript iconnodejs iconcrawlee iconplaywright icon

Crawlee + Playwright + Camoufox

Web scraper example with Crawlee, Playwright and headless Camoufox. Camoufox is a custom stealthy fork of Firefox. Try this template if you're facing anti-scraping challenges.

typescript iconnodejs iconplaywright iconchrome icon

Playwright + Chrome Test Runner

Example of using the Playwright Test project to run automated website tests in the cloud and display their results. Usable as an API.

typescript iconnodejs icon

Empty TypeScript project

Empty template with basic structure for the Actor with Apify SDK that allows you to easily add your own functionality.

typescript iconnodejs icon

Standby TypeScript project

Template with basic structure for an Actor using Standby mode that allows you to easily add your own functionality.

Starter

typescript iconbun iconcheerio iconaxios icon

Start with TypeScript on Bun

Scrape single page with provided URL with Axios and extract data from page's HTML with Cheerio.

Starter

JavaScript templates

javascript iconnodejs icon

🦜️🔗 LangChain

Example of how to use LangChain.js with Apify to crawl the web data, vectorize them, and prompt the OpenAI model.

AI Agent

javascript iconnodejs iconlanggraph icon

LangGraph agent

LangGraph agent in JavaScript for answering questions via web search.

AI Agent

javascript iconnodejs iconcheerio iconaxios icon

Start with JavaScript

Scrape single page with provided URL with Axios and extract data from page's HTML with Cheerio.

Starter

javascript iconnodejs iconcrawlee iconcheerio icon

Crawlee + Cheerio

A scraper example that uses Cheerio to parse HTML. It's fast, but it can't run the website's JavaScript or pass JS anti-scraping challenges.

javascript iconnodejs iconcrawlee iconpuppeteer iconchrome icon

Crawlee + Puppeteer + Chrome

Example of a Puppeteer and headless Chrome web scraper. Headless browsers render JavaScript and are harder to block, but they're slower than plain HTTP.

javascript iconnodejs iconcrawlee iconplaywright iconchrome icon

Crawlee + Playwright + Chrome

Web scraper example with Crawlee, Playwright and headless Chrome. Playwright is more modern, user-friendly and harder to block than Puppeteer.

javascript iconnodejs iconcrawlee iconplaywright icon

Crawlee + Playwright + Camoufox

Web scraper example with Crawlee, Playwright and Camoufox. Camoufox is a custom stealthy fork of Firefox. Try this template if you're facing anti-scraping challenges.

javascript iconnodejs iconcrawlee iconcheerio icon

Bootstrap CheerioCrawler

Skeleton project that helps you quickly bootstrap `CheerioCrawler` in JavaScript. It's best for developers who already know Apify SDK and Crawlee.

javascript iconnodejs iconcypress icon

Cypress

Example of running Cypress tests and saving their results on the Apify platform. JSON results are saved to Dataset, videos to Key-value store.

javascript iconnodejs icon

Empty JavaScript Project

Empty template with basic structure for the Actor with Apify SDK that allows you to easily add your own functionality.

javascript iconnodejs icon

Standby JavaScript Project

Template with basic structure for an Actor using Standby mode that allows you to easily add your own functionality.

Starter

javascript icon

CLI-based Actor starter

Actorize a CLI utility with the Apify Actor CLI

Python templates

python iconlanggraph icon

🦜️🔗 LangGraph AI agent

Example of how to use LangGraph with Apify Actors to create a social media analysis tool-calling agent.

AI Agent

python iconcrewai icon

CrewAI agent

Example of how to use CrewAI with Apify Actors to create a social media analysis tool-calling agent.

AI Agent

python iconllamaindex icon

LlamaIndex agent

LlamaIndex agent to scrape, deduplicate and summarize contact details from a website

AI Agent

python iconpydanticai icon

PydanticAI agent

A PydanticAI agent designed to generate jokes, showcasing a minimal example using the Pydantic AI framework.

AI Agent

python iconsmolagents icon

Smolagents agent

An AI news aggregator that fetches and summarizes the latest news based on user-defined interests using DuckDuckGo search and OpenAI models written in Python Smolagents.

AI Agent

python iconbeautifulsoup icon

Start with Python

Scrape single page with provided URL with HTTPX and extract data from page's HTML with Beautiful Soup.

Starter

python iconbeautifulsoup icon

BeautifulSoup

Example of a web scraper that uses Python HTTPX to scrape HTML from URLs provided on input, parses it using BeautifulSoup and saves results to storage.

python iconplaywright iconchrome icon

Playwright + Chrome

Crawler example that uses headless Chrome driven by Playwright to scrape a website. Headless browsers render JavaScript and can help when getting blocked.

python iconselenium iconchrome icon

Selenium + Chrome

Scraper example built with Selenium and headless Chrome browser to scrape a website and save the results to storage. A popular alternative to Playwright.

python icon

Empty Python project

Empty template with basic structure for the Actor with Apify SDK that allows you to easily add your own functionality.

python icon

Standby Python project

Template with basic structure for an Actor using Standby mode that allows you to easily add your own functionality.

Starter

python iconscrapy icon

Scrapy

This example Scrapy spider scrapes page titles from URLs defined in input parameter. It shows how to use Apify SDK for Python and Scrapy pipelines to save results.

python iconcrawlee iconbeautifulsoup icon

Crawlee + BeautifulSoup

Crawl and scrape websites using Crawlee and BeautifulSoup. Start from a given start URLs, and store results to Apify dataset.

Starter

python iconcrawlee iconplaywright icon

Crawlee + Playwright + Chrome

Crawl and scrape websites using Crawlee and Playwright. Start from a given start URLs, and store results to Apify dataset.

Starter

Apify Universal Scrapers

Universal Scrapers provide you with a solid boilerplate to build fully functioning scrapers directly on the Apify platform. Configure and run your web scrapers manually in a user interface or programmatically via an API.

Cheerio Scraper avatar

Cheerio Scraper

apify/cheerio-scraper

Crawls websites using raw HTTP requests, parses the HTML with the Cheerio library, and extracts data from the pages using a Node.js code. Supports both recursive crawling and lists of URLs. This actor is a high-performance alternative to apify/web-scraper for websites that do not require JavaScript.

User avatar

Apify

7k

4.7

Web Scraper avatar

Web Scraper

apify/web-scraper

Crawls arbitrary websites using the Chrome browser and extracts structured data from web pages using a provided JavaScript function. The Actor supports both recursive crawling and lists of URLs, and automatically manages concurrency for maximum performance.

User avatar

Apify

80k

4.5

Puppeteer Scraper avatar

Puppeteer Scraper

apify/puppeteer-scraper

Crawls websites with the headless Chrome and Puppeteer library using a provided server-side Node.js code. This crawler is an alternative to apify/web-scraper that gives you finer control over the process. Supports both recursive crawling and list of URLs. Supports login to website.

User avatar

Apify

6.1k

5.0

Playwright Scraper avatar

Playwright Scraper

apify/playwright-scraper

Crawls websites with the headless Chromium, Chrome, or Firefox browser and Playwright library using a provided server-side Node.js code. Supports both recursive crawling and a list of URLs. Supports login to a website.

User avatar

Apify

1.2k

4.3

Vanilla JS Scraper avatar

Vanilla JS Scraper

mstephen190/vanilla-js-scraper

Scrape the web using familiar JavaScript methods! Crawls websites using raw HTTP requests, parses the HTML with the JSDOM package, and extracts data from the pages using Node.js code. Supports both recursive crawling and lists of URLs. This actor is a non jQuery alternative to CheerioScraper.

User avatar

Matthias Stephens

454

BS

BeautifulSoup Scraper

apify/beautifulsoup-scraper

Crawls websites using raw HTTP requests. It parses the HTML with the BeautifulSoup library and extracts data from the pages using Python code. Supports both recursive crawling and lists of URLs. This Actor is a Python alternative to Cheerio Scraper.

User avatar

Apify

809

4.4

Already have your own solution?

Sign up for a free Apify account and deploy your code to the platform in just a few minutes! If you need help deploying your code, check out our documentation.