<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>115</id><slug>retry-and-backoff-patterns-part-6-115</slug><title>Retry and backoff patterns, part 6</title><excerpt>In part 6 we take the ideas from earlier instalments and apply them to a larger, messier site. Networks fail, servers restart and rate limits kick in. A scraper that gives up at the first error is…</excerpt><seriesName>Retry and backoff patterns</seriesName><seriesPart>6</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>In part 6 we take the ideas from earlier instalments and apply them to a larger, messier site. Networks fail, servers restart and rate limits kick in. A scraper that gives up at the first error is fragile; one that retries instantly and forever is a nuisance.</item></paragraphs></item><item><heading>A practical approach</heading><paragraphs><item>Write small, focused tests for your parsers using saved HTML fixtures. They run in milliseconds and catch layout changes long before a full crawl would.</item><item>Always identify your client honestly with a descriptive User-Agent, and keep your request rate modest. A crawler that behaves like a considerate visitor is far less likely to cause problems for the site operator.</item><item>Dynamic pages render content after the initial HTML arrives. A browser automation tool can wait for a specific element to appear, which is far more reliable than sleeping for a fixed amount of time.</item></paragraphs></item><item><heading>Common pitfalls</heading><paragraphs><item>Read the site's terms of service before you start. Many sites welcome automated access within limits and say so explicitly; others ask you to use an API instead.</item><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item><item>Deduplicate as you go. The same item often appears on several listing pages, and a stable identifier such as a SKU or ID makes duplicates easy to spot.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Retry only on errors that can succeed later (timeouts, 429, 5xx), use exponential backoff with jitter, and cap the number of attempts.</item></paragraphs></item></sections><authorId>7</authorId><authorName>Kwame Mensah</authorName><authorSlug>kwame-mensah</authorSlug><category>Data Engineering</category><tags><item>http</item><item>javascript</item><item>json</item></tags><publishedAt>2026-07-17T00:00:00.000Z</publishedAt><wordCount>239</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
