{"data":{"id":79,"slug":"structuring-a-data-extraction-pipeline-part-4-79","title":"Structuring a data extraction pipeline, part 4","excerpt":"For part 4, we revisit the basics with a fresh example and a few lessons learned the hard way. A one-off script grows into a pipeline the moment someone asks for the data again next week. A little…","seriesName":"Structuring a data extraction pipeline","seriesPart":4,"sections":[{"heading":"Introduction","paragraphs":["For part 4, we revisit the basics with a fresh example and a few lessons learned the hard way. A one-off script grows into a pipeline the moment someone asks for the data again next week. A little structure early on saves a rewrite later."]},{"heading":"Going further","paragraphs":["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.","Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it."]},{"heading":"What to watch for","paragraphs":["Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.","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."]},{"heading":"Key takeaway","paragraphs":["Separate fetching, parsing and storing into stages, keep raw responses, make each stage re-runnable, and validate records before they reach storage."]}],"authorId":12,"authorName":"Yuki Andersson","authorSlug":"yuki-andersson","category":"Data Engineering","tags":["http","python","javascript","scrapy"],"publishedAt":"2026-03-07T00:00:00.000Z","wordCount":174,"readingTimeMinutes":2}}