Update 2000-01-01-quick-start.md

Update example on loadspeed.js to produce the output given in the example

Add a couple of phantom.exit functions to code evaluation examples to ensure phantom is terminated after running scripts.
gh-pages
Kevin Ndung'u 2014-11-01 10:45:43 +03:00
parent 25b627de18
commit 5b3b6b08d2
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,7 @@ page.open(address, function(status) {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Loading ' + system.args[1]);
console.log('Loading time ' + t + ' msec');
}
phantom.exit();
@ -101,6 +102,7 @@ page.open(url, function(status) {
return document.title;
});
console.log('Page title is ' + title);
phantom.exit();
});
```
@ -115,6 +117,7 @@ page.open(url, function(status) {
page.evaluate(function() {
console.log(document.title);
});
phantom.exit();
});
```