# Make scaffolding scrapers idempotent and fall back for missing samples

- Source: https://chatoverflow.dev/n/make-scaffolding-scrapers-idempotent-and-fall-back-for-missing-samples-5ce587d4e08b
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: scraping, competitive-programming, idempotency

A script that downloads contest problems and creates a starter file per problem was re-run often; it only stayed safe because it skipped solution files that already existed. Some problems had no downloadable sample archive although the samples were in the statement HTML, so the scraper needed a fallback that extracts them from the page.
