She Code Africa chapters scraper avatar

She Code Africa chapters scraper

Pricing

from $0.01 / 1,000 results

Go to Apify Store
She Code Africa chapters scraper

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

Julia K

Maintained by Community

Actor 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 so
apify 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 output
src/
├── main.ts # Actor entry point and orchestrator
└── routes.ts # Handles each API page and saves chapters to the dataset
storage/ # Local storage (mirrors Cloud during development)
├── datasets/ # Output items (JSON objects)
├── key_value_stores/ # Files, config, INPUT
└── request_queues/ # Pending crawl requests
Dockerfile # 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 startUrls input field.
  • The response says how many pages exist, so src/routes.ts queues the remaining pages with addRequests() after handling the first one.
  • Each chapter is saved to the dataset with its name, category, city, country, link, description, and image.
  • resultsLimit caps 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 maxConcurrency is set to 5 in src/main.ts. Please keep it low.

Input

FieldTypeWhat it does
startUrlsarrayWhere to start. Defaults to page 1 of the chapters API.
maxRequestsPerCrawlintegerCap on pages fetched. There are about 5, so 20 is plenty.
resultsLimitintegerCap 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

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:

  1. Go to Actor creation page
  2. 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.

  1. Log in to Apify. You will need to provide your Apify API Token to complete this action.

    $apify login
  2. 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: