casperjs中start方法的使用方法总结


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.








你可能感兴趣的:(casperjs)