Skip to content

Instantly share code, notes, and snippets.

@vitallium
Last active May 13, 2019 18:50
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 vitallium/c3ba4ad5a09aff356e6ba2c60c56f277 to your computer and use it in GitHub Desktop.
Save vitallium/c3ba4ad5a09aff356e6ba2c60c56f277 to your computer and use it in GitHub Desktop.
Version 76.0.152.0 (Official build) dev (64-bit)
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
executablePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe',
args: ['--remote-debugging-port=9222']
});
const page = await browser.newPage();
await page.waitFor(5000);
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
await page.pdf({ path: 'hn.pdf', format: 'A4' });
// await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment