Empty JavaScript Actor
An Actor with the Apify SDK set up, so you can build any tool you need.
src/main.js
1// Crawlee - web scraping and browser automation library (Read more at https://crawlee.dev)2// import { CheerioCrawler } from '@crawlee/cheerio';3// Apify SDK - toolkit for building Apify Actors (Read more at https://docs.apify.com/sdk/js/)4import { Actor, log } from 'apify';5
6// this is ESM project, and as such, it requires you to specify extensions in your relative imports7// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions8// import { router } from './routes.js';9
10// The init() call configures the Actor to correctly work with the Apify-provided environment - mainly the storage infrastructure. It is necessary that every Actor performs an init() call.11await Actor.init();12
13// eslint-disable-next-line no-console14log.info('Hello from the Actor!');15/**16 * Actor code17 */18
19// Gracefully exit the Actor process. It's recommended to quit all Actors with an exit()20await Actor.exit();Start a new web scraping project quickly and easily in JavaScript (Node.js) with our empty project template. It provides a basic structure for building an Actor with Apify SDK and allows you to easily add your own functionality.
This template is useful when you're already familiar with the Apify SDK and Crawlee and want to start with a clean slate. It does not include puppeteer or playwright so install them manually and update the Dockerfile if you need them.
- Node.js tutorials in Academy
- Video guide on getting data using Apify API
- Integration with Make , GitHub, Zapier, Google Drive, and other apps
- A short guide on how to create Actors using code templates:
JavaScript Cheerio crawler
A fast HTTP crawler that extracts data from every page. Good for simple sites like blogs, news, or product listings, but it can't run client-side JavaScript.
JavaScript one-page scraper
Get data from one web page with Cheerio. The simplest way to start scraping.
JavaScript Puppeteer scraper
A headless Chrome scraper that renders JavaScript before extracting data. Good for social feeds, dashboards, or single-page apps.
JavaScript Playwright scraper
A Playwright-based browser scraper supporting multiple browsers and contexts.
JavaScript Camoufox scraper
A Firefox-based browser built to look like a real user and bypass bot protection.
Cheerio crawler (advanced)
A minimal crawler for developers who already know the Apify SDK and Crawlee.