<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>57</id><slug>reading-sitemaps-to-discover-urls-part-3-57</slug><title>Reading sitemaps to discover URLs, part 3</title><excerpt>This is part 3 of our series, and this time we focus on edge cases readers asked about. Before you crawl a site link by link, check whether it already publishes a list of every page it wants found.…</excerpt><seriesName>Reading sitemaps to discover URLs</seriesName><seriesPart>3</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>This is part 3 of our series, and this time we focus on edge cases readers asked about. Before you crawl a site link by link, check whether it already publishes a list of every page it wants found. That list is usually called sitemap.xml.</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>Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.</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>What to watch for</heading><paragraphs><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>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.</item><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></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Look for the Sitemap line in robots.txt, follow sitemap index files to their children, and use lastmod to skip pages that have not changed.</item></paragraphs></item></sections><authorId>2</authorId><authorName>Noah Bennett</authorName><authorSlug>noah-bennett</authorSlug><category>Scraping Basics</category><tags><item>json</item></tags><publishedAt>2024-03-12T00:00:00.000Z</publishedAt><wordCount>220</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
