Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var casper = require('casper').create();
- var limit = 5, count = 1;
- casper.on('load.finished', function (status) {
- if (status !== 'success') {
- this.echo ("Failed to load page.");
- }
- else {
- // this.echo(this.getHTML());
- this.echo('-------------------------');
- }
- this.echo("count: "+count);
- count = count + 1;
- this.echo("count2: "+count);
- if(count > limit) {
- this.echo ("Finished!");
- }
- else {
- var testd = this.evaluate(function(remoteCount) {
- nextPage(remoteCount);
- return remoteCount
- }, count);
- this.echo("testd: "+testd);
- }
- });
- casper.start('http://www.example.com').run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement