{"data":{"id":13,"slug":"exporting-scraped-data-to-csv-13","title":"Exporting scraped data to CSV","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.","seriesName":"Exporting scraped data to CSV","seriesPart":1,"sections":[{"heading":"Introduction","paragraphs":["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."]},{"heading":"Common pitfalls","paragraphs":["Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace.","Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.","Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them."]},{"heading":"Step by step","paragraphs":["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.","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."]},{"heading":"Key takeaway","paragraphs":["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."]}],"authorId":1,"authorName":"Amelia Okafor","authorSlug":"amelia-okafor","category":"Data Engineering","tags":["json"],"publishedAt":"2026-10-16T00:00:00.000Z","wordCount":175,"readingTimeMinutes":2}}