Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / 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