Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-79-npm / puppeteer / puppeteer.js
473 bytesRaw
1 | ; |
2 | |
3 | var fs = require('fs'); |
4 | var puppeteer = require('puppeteer'); |
5 | |
6 | puppeteer.launch().then(function (browser) { |
7 | browser.newPage().then(function (page) { |
8 | page.goto('https://zeit.co').then(function () { |
9 | page.screenshot({ path: 'zeit.png' }).then(function () { |
10 | browser.close(); |
11 | fs.unlinkSync('zeit.png'); |
12 | console.log('ok'); |
13 | }); |
14 | }).catch((error) => { |
15 | console.error(error); |
16 | process.exit(1); |
17 | }); |
18 | }); |
19 | }); |
20 |
Built with git-ssb-web