Tooling ·

Screenshots that wait: capturing 50 live websites properly

A screenshot taken at “page load” is a screenshot of a half-built page. Here is how I capture live sites only after every image has actually arrived.

By Kareem Mohamed, Web Developer at Digital House

Screenshots that wait: capturing 50 live websites properly

For this portfolio I needed website screenshots of every site I have built: more than fifty of them, across WordPress, Shopify, Wix and custom React. The first batch looked fine at a glance. Then you looked closer: blurred heroes, empty sliders, sections that had not faded in yet, newsletter popups sitting on top of everything.

The problem is simple. A browser fires load long before a modern page has finished drawing itself. Images are lazy, sections reveal on scroll, sliders start after a delay. If you shoot at load, you shoot a page that is still getting dressed.

Website screenshots: wait for the page, not the clock

Sleeping for five seconds is not a strategy; it is a guess. What I wait for instead is evidence: every visible image decoded, the fonts ready and the network quiet for a second and a half.

const pending = await page.evaluate(() =>
  [...document.images].filter((img) => {
    const r = img.getBoundingClientRect();
    return r.width > 1 && !(img.complete && img.naturalWidth > 0);
  }).length
);
  • Force lazy images to load: native loading="lazy" plus the common data-src patterns.
  • Walk the whole page slowly, so scroll-reveal sections and infinite sliders wake up.
  • Return to the top, let the hero settle, then check the images again before shooting.

The 100vh trap

My first tall screenshots were taken by making the browser window 2,700px tall. Every hero built with 100vh then became 2,700px tall too. The fix is to keep the real 900px viewport and capture beyond it instead, so sections keep the size a visitor actually sees.

A screenshot is a promise about what a visitor will see. Take it the way a visitor would.

Popups, scroll locks and good manners

Newsletter modals were the last obstacle. Closing them was easy; the surprise was what they left behind: a page still scroll-locked, so “back to the top” silently did nothing. And one rule hid a site’s own hero because it sat on a raised fixed layer. Only real dialogs get closed now.

  • 50 Sites captured
  • 0 Images pending
  • 3 Respected bot checks

The same lazy loading that fools a screenshot tool decides what a visitor sees first, which is why it shows up in Core Web Vitals. Content that only appears after JavaScript runs can also be missed by search engines; how React sites get indexed and the technical SEO checklist cover what to check.