Packs / scraping-automation-public
actor-template
An Apify-style actor in plain Python: input schema -> polite crawl (robots.txt, delay, same host) -> dataset items in Apify's local storage layout. Runs locally or as a container.
Install
logicpacks pack use scraping-automation-public/actor-templateget_pack scraping-automation-public/actor-templateThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
local - Checks: 1 in
outcome/checks.yaml - Code:
.actor/Dockerfile.actor/actor.json.actor/input_schema.jsoncheck_actor.shmain.pywith_local_site.sh - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
An Apify-style actor in plain Python: input schema -> polite crawl (robots.txt, delay, same host) -> dataset items in Apify's local storage layout. Runs locally or as a container.
Goal
A reusable actor skeleton that turns an input (start URLs, limits) into a dataset of page items, runnable locally and deployable to Apify unchanged in shape.
Routes (free first)
local(local):python3 code/main.py --storage ./storage --input <json>- runs on any machine; no account
Steps
- Copy code/ into a new folder; edit
Page(what to extract) and theitemdict in main.py. - Describe the input in code/.actor/input_schema.json (Apify renders it as a form).
- Run locally:
python3 code/main.py --storage ./storage --input '{"startUrls": ["https://example.com"], "maxPages": 5}'. - Read results from storage/datasets/default/*.json and the summary from storage/key_value_stores/default/OUTPUT.json.
- Deploy to Apify:
apify pushfrom the folder with .actor/ (needs the Apify CLI and APIFY_TOKEN), or run the Dockerfile anywhere on a schedule (scheduled-job pack).
Edge cases
- Pages that need JavaScript return empty shells: switch the fetch to Playwright (browser-automation space) for those hosts only.
- Respect robots.txt and add a delay; many sites block bursts (403/429) and some block plain curl (Indeed, Glassdoor) while others work (see ats-job-boards).
- Cap pages and bytes per page so a crawl loop can't run away.
- Results can contain personal data (names, emails, phones): store only what the job needs and never publish it.
Don'ts
- Don't bypass logins, paywalls or CAPTCHAs.
- Don't crawl a client's competitor or any site at high rate without the owner's OK.
- Don't commit storage/ (datasets) to a space repo.