Puppeteer has the ability to take screenshots of a website, but it comes with some limitations. If your site's height or width exceeds ~16,000 pixels then you're likely to notice some blank spots. While this might leave you scratching your head, the solution is pretty easy.
At the time of this writing (puppeteer@1.1.0
), puppeteer has had issues with rendering large webpages during screenshots. To get around this you'll need to take "chunks" of screenshots from your site and recombine them later. Below is a simple example where we split a website into two screenshots and re-merge later using the merge-img
package on npm
Snapshot and combine
You'll simply have to insert your own values for pageUrl
and pageElement
in order for this to work on your site. If your site happens to be over 3,200px in any direction then you'll have to get a little fancier and separate/combine more segments.
I hope this helps you with your journey in puppeteer!