casperjs中start方法的使用方法總結

Winterto1990發表於2015-10-16


Signature: start(String url[, Function then])

Configures and starts Casper, then opens the provided url and optionally adds the step provided by the then argument:

casper.start('http://google.fr/', function() {
this.echo("I'm loaded.");
});
casper.run();

也可以:

casper.start('http://google.fr/');
casper.then(function() {
       this.echo("I'm loaded.");
});
casper.run();

另外還可以:

casper.start('http://google.fr/');
casper.then(function() {
casper.echo("I'm loaded.");
});
casper.run();

You must call the start() method in order to be able to add navigation steps and run the suite. If you don’t
you’ll get an error message inviting you to do so anyway.








相關文章