<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>63</id><slug>respecting-robots-txt-in-practice-part-4-63</slug><title>Respecting robots.txt in practice, part 4</title><excerpt>For part 4, 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>4</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>For part 4, 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>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>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>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>Putting it into practice</heading><paragraphs><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item><item>Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.</item><item>Be careful with relative URLs. Resolve every link against the page it came from, not against the site root, or you will request pages that do not exist.</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>3</authorId><authorName>Priya Nakamura</authorName><authorSlug>priya-nakamura</authorSlug><category>Ethics &amp; Law</category><tags><item>scrapy</item><item>python</item><item>selenium</item></tags><publishedAt>2026-02-10T00:00:00.000Z</publishedAt><wordCount>222</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
