{"data":{"id":56,"slug":"detecting-lazy-loaded-content-part-3-56","title":"Detecting lazy-loaded content, part 3","excerpt":"For part 3, we revisit the basics with a fresh example and a few lessons learned the hard way. Lazy loading defers images and sections until they are about to scroll into view. A script that reads…","seriesName":"Detecting lazy-loaded content","seriesPart":3,"sections":[{"heading":"Introduction","paragraphs":["For part 3, we revisit the basics with a fresh example and a few lessons learned the hard way. Lazy loading defers images and sections until they are about to scroll into view. A script that reads the page immediately sees placeholders instead of content."]},{"heading":"What to watch for","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.","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.","Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace."]},{"heading":"Going further","paragraphs":["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.","Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.","Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it."]},{"heading":"Key takeaway","paragraphs":["Scroll the element into view and wait for its real attributes to appear, or read the data-src style attributes that hold the eventual values."]}],"authorId":10,"authorName":"Aisha Rossi","authorSlug":"aisha-rossi","category":"Browser Automation","tags":["ethics","http"],"publishedAt":"2026-03-07T00:00:00.000Z","wordCount":237,"readingTimeMinutes":2}}