-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.js
30 lines (27 loc) · 956 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var phantomas = require('phantomas');
// var task2 = phantomas('http://market.showjoy.com/activity/ctopic/23929.html', function (err, json, results) {
// console.log([
// 'phantomas results',
// json, // parsed JSON with raw results
// results.getAsserts() // results object with metrics values, offenders, asserts data
// ]);
// })
// task2.on('results', function (results) {
// console.log([
// 'task results',
// results,
// results.getMetrics()
// ]);
// })
var domComplete = 0;
var task = phantomas('http://showjoy.com', function (err, json, results) {
// console.log([
// 'phantomas results',
// json, // parsed JSON with raw results
// results.getAsserts() // results object with metrics values, offenders, asserts data
// ]);
})
task.on('results', function (results) {
domComplete = results.getMetrics();
console.log(domComplete);
})