<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>183</id><slug>respecting-robots-txt-in-practice-part-10-183</slug><title>Respecting robots.txt in practice, part 10</title><excerpt>In part 10 we take the ideas from earlier instalments and apply them to a larger, messier site. 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>10</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>In part 10 we take the ideas from earlier instalments and apply them to a larger, messier site. 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>Putting it into practice</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>Log every request with its URL, status code and duration. When something goes wrong at two in the morning, those logs are the difference between a quick fix and a long investigation.</item><item>Pagination comes in several shapes: numbered pages, next links, offsets and opaque cursors. Each has trade-offs, and a robust scraper should detect the end of the result set rather than assuming a fixed number of pages.</item></paragraphs></item><item><heading>Step by step</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>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><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>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>4</authorId><authorName>Lucas Silva</authorName><authorSlug>lucas-silva</authorSlug><category>Ethics &amp; Law</category><tags><item>scrapy</item><item>playwright</item><item>ethics</item></tags><publishedAt>2025-08-03T00:00:00.000Z</publishedAt><wordCount>243</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
