VOOZH about

URL: https://apify.com/vernacular_reservoir/trivia-quiz-scraper

โ‡ฑ Trivia Quiz Scraper - Questions & Answers ยท Apify


๐Ÿ‘ Trivia Quiz Scraper - Questions & Answers avatar

Trivia Quiz Scraper - Questions & Answers

Pricing

Pay per usage

Go to Apify Store

Trivia Quiz Scraper - Questions & Answers

Fetch trivia quiz questions from Open Trivia DB. Filter by category, difficulty and type. Categories include science, history, geography, sports, music, film and more. Get questions with correct and incorrect answers ready for quiz apps. No API key required.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

๐Ÿ‘ Aleksandrs

Aleksandrs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 days ago

Last modified

Share

JavaScript Crawlee & CheerioCrawler Actor Template

This template example was built with Crawlee to scrape data from a website using Cheerio wrapped into CheerioCrawler.

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.js # Actor entry point and orchestrator
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

This code is a JavaScript script that uses Cheerio to scrape data from a website. It then stores the website titles in a dataset.

  • The crawler starts with URLs provided from the input startUrls field defined by the input schema. Number of scraped pages is limited by maxPagesPerCrawl field from the input schema.
  • The crawler uses requestHandler for each URL to extract the data from the page with the Cheerio library and to save the title and URL of each page to the dataset. It also logs out each result that is being saved.

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. In short, you will:

  1. Build the Actor
  2. Run the Actor

Pull the Actor for local development

If you would like to develop locally, you can pull the existing Actor from Apify console using Apify CLI:

  1. Install apify-cli

    Using Homebrew

    $brew install apify-cli

    Using NPM

    $npm-ginstall apify-cli
  2. Pull the Actor by its unique <ActorId>, which is one of the following:

    • unique name of the Actor to pull (e.g. "apify/hello-world")
    • or ID of the Actor to pull (e.g. "E2jjCZBezvAZnX8Rb")

    You can find both by clicking on the Actor title at the top of the page, which will open a modal containing both Actor unique name and Actor ID.

    This command will copy the Actor into the current directory on your local machine.

    $apify pull <ActorId>

Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

You might also like

Open Trivia DB Quiz Questions Scraper

parseforge/opentdb-trivia-scraper

Pull trivia questions from Open Trivia DB. Returns category, type (multiple/true-false), difficulty, question text, correct answer, incorrect answers. Filter by category (24 supported: science, history, geography, art, sports, etc.), difficulty (easy/medium/hard), or type.

Open Trivia Database Scraper

crawlerbros/opentriviadb-scraper

Scrape trivia questions from the Open Trivia Database (opentdb.com). Filter by category, difficulty, and question type. Returns questions with correct and incorrect answers. No API key required.

OpenTDB Trivia Scraper

gio21/opentdb-trivia-scraper

Open Trivia Database scraper. Pull multiple-choice or true/false trivia by category, difficulty. 4000+ questions across 24 categories (general, books, film, music, science, history, sports, geography, animals, etc.). For quiz apps, edtech, games.

Trivia Actor

pintostudio/trivia-actor

A powerful and easy-to-use actor for generating trivia questions. Perfect for creating quiz applications, educational content, or entertainment purposes.

AI Quiz Maker

harvestlabs/ai-quiz-maker

Transforms user input into a structured study quiz. Given a user's request, the agent extracts the core topic, and generates a multi-difficulty quiz in various formats (Markdown, HTML, JSON).

Sephora Reviews and Questions Scraper

scraped/sephora-reviews-and-questions-scraper

Scrape product reviews and questions and answers from Sephora

Ai Question Generator

sunvic567/ai-question-generator

Generate educational questions from any document automatically. AI-powered quiz maker creates multiple choice, true/false, essay questions from PDFs and DOCX files. Perfect for teachers, trainers, and e-learning. Customize difficulty, export to JSON/CSV/Moodle XML. Turn documents into assessments.

5

4.0