She Code Africa chapters scraper
Pricing
from $0.01 / 1,000 results
She Code Africa chapters scraper
Scrapes every She Code Africa community chapter and its link.
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer
Julia K
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
18 hours ago
Last modified
Categories
Share
Scrapes every She Code Africa community chapter - the name, where it is, and the link to its own page - and saves them to a dataset.
Built from the TypeScript Crawlee + CheerioCrawler Actor template, then customized.
Quick Start
Once you've installed the dependencies, start the Actor:
$apify run
Once your Actor is ready, you can push it to the Apify Console:
apify login # first, you need to log in if you haven't already done soapify push
Project Structure
.actor/├── actor.json # Actor config: name, version, env vars, runtime settings├── dataset_schema.json # Structure and representation of data produced by an Actor├── input_schema.json # Input validation & Console form definition└── output_schema.json # Specifies where an Actor stores its outputsrc/├── main.ts # Actor entry point and orchestrator└── routes.ts # Handles each API page and saves chapters to the datasetstorage/ # Local storage (mirrors Cloud during development)├── datasets/ # Output items (JSON objects)├── key_value_stores/ # Files, config, INPUT└── request_queues/ # Pending crawl requestsDockerfile # Container image definition
For more information, see the Actor definition documentation.
How it works
The She Code Africa website is a React app, so the HTML the server sends back is an empty
<div id="root"> - there is nothing in it for Cheerio to read. The page fills itself from a
public JSON API, so this Actor scrapes that API directly. It is faster than rendering a browser,
and the data arrives already structured.
- The crawler starts at page 1 of the chapters API, taken from the
startUrlsinput field. - The response says how many pages exist, so
src/routes.tsqueues the remaining pages withaddRequests()after handling the first one. - Each chapter is saved to the dataset with its name, category, city, country, link, description, and image.
resultsLimitcaps how many chapters get saved. Leave it empty to save all of them. If the limit is filled by page 1, the remaining pages are never fetched at all.
At the time of writing that is 46 chapters across 9 countries, fetched in 5 requests.
Note: She Code Africa is a non-profit running on a small server, so
maxConcurrencyis set to 5 insrc/main.ts. Please keep it low.
Input
| Field | Type | What it does |
|---|---|---|
startUrls | array | Where to start. Defaults to page 1 of the chapters API. |
maxRequestsPerCrawl | integer | Cap on pages fetched. There are about 5, so 20 is plenty. |
resultsLimit | integer | Cap on chapters saved. Empty means all of them (about 46). |
Example output
{"name": "SCA UNN","category": "Campus","city": "Enugu","country": "Nigeria","link": "https://linktr.ee/scaunn","description": "An SCA Chapter in the University of Nigeria Nsukka, Enugu","image": "https://ik.imagekit.io/gcrrtxwk5/SCA_WEBSITE_V3/PRODUCTION/CHAPTERS/50.png"}
What's included
- Apify SDK - toolkit for building Actors
- Crawlee - web scraping and browser automation library
- Input schema - define and easily validate a schema for your Actor's input
- Dataset - store structured data where each object stored has the same attributes
- Cheerio - a fast, flexible & elegant library for parsing and manipulating HTML and XML
- Proxy configuration - rotate IP addresses to prevent blocking
Resources
- Quick Start guide for building your first Actor
- Video tutorial on building a scraper using CheerioCrawler
- Written tutorial on building a scraper using CheerioCrawler
- Web scraping with Cheerio in 2023
- How to scrape a dynamic page using Cheerio
- Integration with Zapier, Make, Google Drive and others
- Video guide on getting data using Apify API
Creating Actors with templates
Getting started
For complete information see this article. To run the Actor use the following command:
$apify run
Deploy to Apify
Connect Git repository to Apify
If you've created a Git repository for the project, you can easily connect to Apify:
- Go to Actor creation page
- Click on Link Git Repository button
Push project on your local machine to Apify
You can also deploy the project on your local machine to Apify without the need for the Git repository.
-
Log in to Apify. You will need to provide your Apify API Token to complete this action.
$apify login -
Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under Actors -> My Actors.
$apify push
Documentation reference
To learn more about Apify and Actors, take a look at the following resources: