A Guide to Scraping with Puppeteer & GitHub Actions

An example of automating web scraping using Puppeteer and GitHub Actions.

How It Works

  1. A Node.js script (scrape.js) uses Puppeteer to open quotes.toscrape.com.
  2. The script scrapes the first 10 quotes.
  3. The data is saved to a file: public/data.json.
  4. A GitHub Actions workflow (.github/workflows/scrape.yml) runs this script on a schedule.
  5. The workflow will push the new data.json file to the repository if there are changes.
  6. This page fetches the data from data.json and displays it below.

Configuration

Scraped Results: Top 10 Quotes

Loading data...