node js puppeteer how to get screenshot in a variable code example Example: puppeteer take screenshot await page.screenshot({path: 'screenshot.png'});