{"data":{"id":99,"slug":"structuring-a-data-extraction-pipeline-part-5-99","title":"Structuring a data extraction pipeline, part 5","excerpt":"This is part 5 of our series, and this time we focus on edge cases readers asked about. A one-off script grows into a pipeline the moment someone asks for the data again next week. A little structure…","seriesName":"Structuring a data extraction pipeline","seriesPart":5,"sections":[{"heading":"Introduction","paragraphs":["This is part 5 of our series, and this time we focus on edge cases readers asked about. 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":"What to watch for","paragraphs":["Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.","Selectors are the most fragile part of any scraper. Prefer stable attributes such as data-testid or semantic structure over generated class names, which can change on every deploy."]},{"heading":"Putting it into practice","paragraphs":["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.","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."]},{"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":2,"authorName":"Noah Bennett","authorSlug":"noah-bennett","category":"Data Engineering","tags":["playwright","json","http","ethics"],"publishedAt":"2025-07-20T00:00:00.000Z","wordCount":176,"readingTimeMinutes":2}}