An Actor with the Scrapely SDK set up, so you can build any tool you need.
Create it locally
$scrapely create my-actor --template js-empty
Main file
.JS
src/main.js// Crawlee - web scraping and browser automation library (Read more at https://crawlee.dev)
// import { CheerioCrawler } from '@crawlee/cheerio';
import { Actor, log } from 'scrapely';
// this is ESM project, and as such, it requires you to specify extensions in your relative imports
// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
// import { router } from './routes.js';
// The init() call configures the Actor to correctly work with the platform-provided environment - mainly the storage infrastructure. It is necessary that every Actor performs an init() call.
await Actor.init();
// eslint-disable-next-line no-console
log.info('Hello from the Actor!');
/**
* Actor code
*/
// Gracefully exit the Actor process. It's recommended to quit all Actors with an exit()
await Actor.exit();
Empty JavaScript Actor
An Actor with the Scrapely SDK set up, so you can build any tool you need.
Included features
- Scrapely SDK — Actor lifecycle, input, storage and proxies
- Input schema — define and validate the Actor's input (
.actor/input_schema.json) - Dataset schema — structured results with a preview view (
.actor/dataset_schema.json)
Getting started locally
npm install
npm run start # run the Actor
Deploying to Scrapely
Create an Actor from this template in the Scrapely Console (Develop new → template → Git). Scrapely creates a repository in your account, pushes this code, and builds the Actor. Every push to your repository triggers a new build.