puppeteer-webshots

0.0.3 • Public • Published

Puppeteer Webshots

Example

const {PuppeteerBrowser, PuppeteerWebshots} = require('puppeteer-webshots');

let browser = new PuppeteerBrowser({maxPages: 2});
let screenshots = new PuppeteerWebshots(browser);

screenshots.timedScreenshots(
	'http://myurl.com',
	{width: 1920, height: 1080},
	[1000, 2000, 4000, 20000]
)
.then(() => console.log("DONE"))
.catch((error) => console.error(error));

// Cancel it manually
setTimeout(function() {
	screenshots.cancel();
}, 20000);

screenshots.on('screenshot', function({time, screenshot}) {
	console.log(time, screenshot);
});

Readme

Keywords

none

Package Sidebar

Install

npm i puppeteer-webshots

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

5.69 kB

Total Files

6

Last publish

Collaborators

  • johnvmt