<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>143</id><slug>respecting-robots-txt-in-practice-part-8-143</slug><title>Respecting robots.txt in practice, part 8</title><excerpt>For part 8, we revisit the basics with a fresh example and a few lessons learned the hard way. robots.txt is a short text file with a long history. It tells automated clients which parts of a site…</excerpt><seriesName>Respecting robots.txt in practice</seriesName><seriesPart>8</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>For part 8, we revisit the basics with a fresh example and a few lessons learned the hard way. robots.txt is a short text file with a long history. It tells automated clients which parts of a site the operator would prefer they left alone, and how quickly they should crawl the rest.</item></paragraphs></item><item><heading>Going further</heading><paragraphs><item>Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace.</item><item>Store raw responses alongside parsed output while you are developing. When a parser breaks, you can replay the saved HTML instead of hitting the site again.</item><item>Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.</item></paragraphs></item><item><heading>Common pitfalls</heading><paragraphs><item>Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.</item><item>Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.</item><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Fetch robots.txt before you crawl, honour Disallow rules and Crawl-delay values, and re-check it periodically because sites change their policies.</item></paragraphs></item></sections><authorId>12</authorId><authorName>Yuki Andersson</authorName><authorSlug>yuki-andersson</authorSlug><category>Ethics &amp; Law</category><tags><item>json</item><item>ethics</item><item>selenium</item><item>javascript</item></tags><publishedAt>2024-03-02T00:00:00.000Z</publishedAt><wordCount>202</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
