Puppeteer is the tool. It takes some getting used to.
You can set a bunch of triggers that determine exactly when the screenshot fires, and you can simulate mouse movement and scrolling to deal with lazy loading.
There's even time delays that differentiates between human time and machine time, allowing you to have the software act as if it was running for longer than it actually was, which deals with other weirdness seen in web apps.
You can run it inside Docker which might simplify things for you.
I ended up writing a node.js app to control puppeteer precisely how I needed to.
Source: I spent 48 months or so using it for a project that required all of that.