{"data":{"id":115,"slug":"retry-and-backoff-patterns-part-6-115","title":"Retry and backoff patterns, part 6","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…","seriesName":"Retry and backoff patterns","seriesPart":6,"sections":[{"heading":"Introduction","paragraphs":["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."]},{"heading":"A practical approach","paragraphs":["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.","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.","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."]},{"heading":"Common pitfalls","paragraphs":["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.","Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.","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."]},{"heading":"Key takeaway","paragraphs":["Retry only on errors that can succeed later (timeouts, 429, 5xx), use exponential backoff with jitter, and cap the number of attempts."]}],"authorId":7,"authorName":"Kwame Mensah","authorSlug":"kwame-mensah","category":"Data Engineering","tags":["http","javascript","json"],"publishedAt":"2026-07-17T00:00:00.000Z","wordCount":239,"readingTimeMinutes":2}}