Working on a project where I need to grab screenshots of pages on a schedule — mostly for QA and keeping a visual history of what changed and when.

Right now I’m running Puppeteer in a cron job on a cheap VPS. It works, but honestly it’s a pain to maintain. Chromium eats RAM like crazy, sometimes it hangs and the whole thing needs a restart, and the screenshots come out wrong on pages that load content dynamically.

A few things I’ve been struggling with:

  • Pages with lazy-loaded images — half the time the screenshot fires before everything renders
  • Cookie consent banners blocking the actual content
  • Memory usage goes through the roof when I try to do more than ~50 pages in a batch

I’ve looked into Playwright as a replacement but from what I can tell the resource usage is about the same. Also tried running headless Chrome in Docker which at least makes cleanup easier, but didn’t solve the core problems.

Curious what others are using. Are screenshot APIs worth it for this kind of thing, or is self-hosting still the way to go? Anyone running something similar at scale?

  • Onno (VK6FLAB)@lemmy.radio
    link
    fedilink
    arrow-up
    1
    ·
    15 hours ago

    An extra observation, if you’re doing QA and you’re running out of memory, there is a good chance that the actual users will experience the same issue.

    If you’re running this inside Docker, you can specify exactly how much memory it has access to, which can also act as a data point for your QA process.