<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>13</id><slug>exporting-scraped-data-to-csv-13</slug><title>Exporting scraped data to CSV</title><excerpt>CSV is the lingua franca of spreadsheets and the most common way scraped data leaves a project. It is also surprisingly easy to produce a CSV that opens incorrectly.</excerpt><seriesName>Exporting scraped data to CSV</seriesName><seriesPart>1</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>CSV is the lingua franca of spreadsheets and the most common way scraped data leaves a project. It is also surprisingly easy to produce a CSV that opens incorrectly.</item></paragraphs></item><item><heading>Common pitfalls</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>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item><item>Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.</item></paragraphs></item><item><heading>Step by step</heading><paragraphs><item>Dynamic pages render content after the initial HTML arrives. A browser automation tool can wait for a specific element to appear, which is far more reliable than sleeping for a fixed amount of time.</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>Use a proper CSV writer rather than joining strings, quote fields that contain commas or newlines, write UTF-8, and keep dates in ISO 8601.</item></paragraphs></item></sections><authorId>1</authorId><authorName>Amelia Okafor</authorName><authorSlug>amelia-okafor</authorSlug><category>Data Engineering</category><tags><item>json</item></tags><publishedAt>2026-10-16T00:00:00.000Z</publishedAt><wordCount>175</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
