<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>4</id><slug>building-a-polite-scrapy-spider-4</slug><title>Building a polite Scrapy spider</title><excerpt>Scrapy makes it very easy to send thousands of requests a minute. Making a spider that a site operator would be happy to see in their logs takes a few deliberate settings.</excerpt><seriesName>Building a polite Scrapy spider</seriesName><seriesPart>1</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>Scrapy makes it very easy to send thousands of requests a minute. Making a spider that a site operator would be happy to see in their logs takes a few deliberate settings.</item></paragraphs></item><item><heading>What to watch for</heading><paragraphs><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>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><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>Putting it into practice</heading><paragraphs><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>Before writing a single line of code, look at how the page actually loads its data. Open the network panel, reload, and note which requests return the content you care about. Very often the data you want arrives as JSON from an endpoint you can call directly.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Turn on ROBOTSTXT_OBEY, set AutoThrottle, use a descriptive User-Agent with contact details, and cache responses while you develop.</item></paragraphs></item></sections><authorId>8</authorId><authorName>Hannah Novak</authorName><authorSlug>hannah-novak</authorSlug><category>Scraping Basics</category><tags><item>javascript</item><item>scrapy</item><item>selenium</item></tags><publishedAt>2026-09-20T00:00:00.000Z</publishedAt><wordCount>219</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
