Standby JavaScript Project
Template with basic structure for an Actor using Standby mode that allows you to easily add your own functionality.
src/main.js
1import http from 'http';
2// Apify SDK - toolkit for building Apify Actors (Read more at https://docs.apify.com/sdk/js/)
3import { Actor } from 'apify';
4
5// this is ESM project, and as such, it requires you to specify extensions in your relative imports
6// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
7// import { router } from './routes.js';
8
9// The init() call configures the Actor for its environment. It's recommended to start every Actor with an init()
10await Actor.init();
11
12// Create a simple HTTP server that will respond with a message
13const server = http.createServer((req, res) => {
14 res.writeHead(200, { 'Content-Type': 'text/plain' });
15 res.end('Hello from Actor Standby!\n');
16});
17
18// Listen on the standby port
19server.listen(Actor.config.get('standbyPort'));
Standby JavaScript template
Start a new web scraping project quickly and easily in JavaScript (Node.js) with our Standby project template. It provides a basic structure for building an Actor with Apify SDK and allows you to easily add your own functionality.
Included features
Resources
Scrape single page with provided URL with Axios and extract data from page's HTML with 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.
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.
Web scraper example with Crawlee, Playwright and headless Chrome. Playwright is more modern, user-friendly and harder to block than Puppeteer.
Skeleton project that helps you quickly bootstrap `CheerioCrawler` in JavaScript. It's best for developers who already know Apify SDK and Crawlee.
Example of running Cypress tests and saving their results on the Apify platform. JSON results are saved to Dataset, videos to Key-value store.