Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / 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