Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / phantom / phantom.js
454 bytesRaw
1 | ; |
2 | |
3 | var phantom = require('phantom'); |
4 | |
5 | var instance, page; |
6 | Promise.resolve().then(function () { |
7 | return phantom.create(); |
8 | }).then(function (i) { |
9 | instance = i; |
10 | return instance.createPage(); |
11 | }).then(function (p) { |
12 | page = p; |
13 | return page.open('https://stackoverflow.com/'); |
14 | }).then(function () { |
15 | return page.property('content'); |
16 | }).then(function (content) { |
17 | if (content.length > 1000) console.log('ok'); |
18 | return instance.exit(); |
19 | }); |
20 |
Built with git-ssb-web