Created
September 15, 2017 14:09
-
-
Save aanton/b4c9cedc0dd2437703d86507c69cdffe to your computer and use it in GitHub Desktop.
Revisions
-
aanton created this gist
Sep 15, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ '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.setRequestInterceptionEnabled(true); page.on('request', request => { if (request.resourceType === 'Script') { request.abort(); } else { request.continue(); } }); await page.goto('http://listas.20minutos.es/'); await page.screenshot({path: 'screenshot.png', clip: {x: 0, y:0, width: 1024, height: 800} }); // await page.screenshot({path: 'screenshot-full.png', fullPage: true}); browser.close(); })();