This is part 5 of our series, and this time we focus on edge cases readers asked about. 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.

Step by step

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.

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.

Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.

What to watch for

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.

Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.

Key takeaway

Fetch robots.txt before you crawl, honour Disallow rules and Crawl-delay values, and re-check it periodically because sites change their policies.