sheetjs-clone/demos/headless/puppeteer.js

15 lines
393 B
JavaScript
Raw Normal View History

/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
2021-09-09 06:01:53 +00:00
await page.goto('http://oss.sheetjs.com/sheetjs/tests/', {waitUntil: 'load'});
await page.waitFor(30*1000);
await page.pdf({path: 'test.pdf', format: 'A4'});
browser.close();
})();