blob: 4cf891110925a76367fbd299ccc97b1c64eb6813 [file] [log] [blame]
#!/usr/bin/env node
const puppeteer = require('puppeteer');
function delay(time) {
return new Promise(function (resolve) {
setTimeout(resolve, time)
});
}
(async () => {
const browser = await puppeteer.launch({
headless: "new",
args: ['--no-sandbox'],
defaultViewport: {
width: 1920,
height: 1080,
isLandscape: true,
deviceScaleFactor: 0.5
}
});
const page = await browser.newPage();
for (var i = 2; i < process.argv.length; i += 2) {
await page.goto(process.argv[i], { waitUntil: 'networkidle2' });
await delay(1000);
await page.screenshot({ path: process.argv[i+1] });
}
await browser.close();
})();