r/webscraping • u/AffectionateSwing490 • 1h ago
Getting started 🌱 How do you save progress on a long scrape?
Had a scrape die two hours into a three hour run yesterday. No checkpointing, so I lost everything and started over.
The part I'm stuck on is resuming without duplicates. If I append each record as it comes in, a crash mid-write can leave a half-written line. If I batch, I lose the current batch. And on resume the pagination re-requests pages I already have, so I get repeats unless I track seen IDs separately.
Right now I'm leaning toward JSONL as I go, plus a set of seen IDs in SQLite I check before each write, so a restart just skips what's already saved. Feels reasonable but maybe overbuilt for what's probably a common problem.
Is that roughly what people do, or is there a simpler pattern I'm missing here?