CLI-based Actor starter
Actorize a CLI utility with the Apify Actor CLI
main.sh
1#!/bin/bash
2set -ex
3
4# Parse input values
5input="$(apify actor get-input)"
6name="$(jq -r .name <<< "$input")"
7
8# Construct an output object and push it to the dataset (Actor results)
9echo '{}' |
10 jq ".name = \"$name\"" |
11 jq ".greeting = \"Hello $name!\"" |
12 apify actor push-data
Actor CLI starter template
Start a new Actorization project quickly and easily with this project template. It provides a basic structure for building an Actor with the Apify CLI and allows you to easily add your own functionality.
Included features
- Apify CLI - toolkit for building Actors that interact with the Apify platform.
- jq - a command line filter for working with JSON
How it works
This template is useful when you're already familiar with the Apify Platform and want to use the Apify CLI to turn almost any project into an Actor.
Resources
- Actor development in Apify documentation - see especially the actor.json part
- Actor whitepaper for a deep dive into the Actor computing model
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.
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.
Skeleton project that helps you quickly bootstrap `CheerioCrawler` in JavaScript. It's best for developers who already know Apify SDK and Crawlee.