McOkapi

joined 4 months ago
 

Taking accurate screenshots with Puppeteer has been a real pain, especially with pages that don’t fully load when the standard waitUntil: load fires. A real pain. Some sites, particularly SPAs built with Angular, React, or Vue, end up half-loaded, leaving me with screenshots where parts of the page are just blank. Peachy, just peachy.

I've had the same issue with waitUntil: domcontentloaded, but that one was kind of expected. The problem is that the page load event fires too early, and for pages relying on JavaScript to load images or other resources, this means the screenshot captures a half-baked page. Useless, obviously.

After some digging accompanied by a certain type of language (the beep type), I did find a few workarounds. For example, you can use Puppeteer to wait for specific DOM elements to appear or disappear. Another approach is to wait for the network to be idle for a certain time. But what really helped was finding a custom function that waits for the DOM updates to settle (source). It’s the closest to a solution for getting fully loaded screenshots across different types of websites, at least from what I was able to find. Hope it will help anyone who struggles with this issue.

[–] [email protected] 2 points 3 months ago (1 children)

I wasn't aware of this, when did it start? So far, it has never happened to me not to be able to view reddit threads

[–] [email protected] 4 points 3 months ago

Same here. Maybe it partly has to do with age, but definitely not only. I get super nostalgic about very few things - this game is one of them.

[–] [email protected] 2 points 3 months ago* (last edited 3 months ago)

I use the ChatGPT Google Sheets extension pretty much every day to create tables, charts, and all kinds of lists for various clients and projects. The results are excellent, and it saves me a significant amount of time.

[–] [email protected] 1 points 3 months ago

I agree, people don't really pay attention or bother to read about stuff like How to check if a QR code is safe. Honestly, I've been dealing with QR codes for quite a while, and I still occasionally spend time looking things up, reading about quishing, and whatever new scam/term appears.

[–] [email protected] 2 points 3 months ago (1 children)

This is actually not a bad idea at all. Although no hope for skipping unhealthy snacks.

[–] [email protected] 1 points 4 months ago

Just make sure that busy comes with money and that it ends at some point.

Excellent point.