{"data":{"id":43,"slug":"respecting-robots-txt-in-practice-part-3-43","title":"Respecting robots.txt in practice, part 3","excerpt":"Part 3 looks at what changes when the same technique has to run every day in production. robots.txt is a short text file with a long history. It tells automated clients which parts of a site the…","seriesName":"Respecting robots.txt in practice","seriesPart":3,"sections":[{"heading":"Introduction","paragraphs":["Part 3 looks at what changes when the same technique has to run every day in production. 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."]},{"heading":"Step by step","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.","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."]},{"heading":"Common pitfalls","paragraphs":["Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.","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."]},{"heading":"Key takeaway","paragraphs":["Fetch robots.txt before you crawl, honour Disallow rules and Crawl-delay values, and re-check it periodically because sites change their policies."]}],"authorId":5,"authorName":"Chen Patel","authorSlug":"chen-patel","category":"Ethics & Law","tags":["javascript","scrapy","ethics"],"publishedAt":"2025-12-10T00:00:00.000Z","wordCount":182,"readingTimeMinutes":2}}