Skip to content

Instantly share code, notes, and snippets.

@almaron
Created March 19, 2019 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almaron/43bc4be3231a7550e405a5f6d70d5bb6 to your computer and use it in GitHub Desktop.
Save almaron/43bc4be3231a7550e405a5f6d70d5bb6 to your computer and use it in GitHub Desktop.
'use strict';
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch({
headless: true,
ignoreHTTPSErrors: true,
timeout: 1000
});
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', request => {
if (request.resourceType === 'Script') {
request.abort();
} else {
request.continue();
}
});
await page.setViewport({width: 1920, height: 1080});
await page.goto(process.argv[2]);
const screen = await page.screenshot({encoding: 'base64', fullPage: true});
console.log(screen);
browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment