<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>76</id><slug>detecting-lazy-loaded-content-part-4-76</slug><title>Detecting lazy-loaded content, part 4</title><excerpt>This is part 4 of our series, and this time we focus on edge cases readers asked about. Lazy loading defers images and sections until they are about to scroll into view. A script that reads the page…</excerpt><seriesName>Detecting lazy-loaded content</seriesName><seriesPart>4</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>This is part 4 of our series, and this time we focus on edge cases readers asked about. 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.</item></paragraphs></item><item><heading>Common pitfalls</heading><paragraphs><item>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.</item><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>Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.</item></paragraphs></item><item><heading>Going further</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></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>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.</item></paragraphs></item></sections><authorId>7</authorId><authorName>Kwame Mensah</authorName><authorSlug>kwame-mensah</authorSlug><category>Browser Automation</category><tags><item>playwright</item><item>javascript</item></tags><publishedAt>2025-10-08T00:00:00.000Z</publishedAt><wordCount>200</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
