我不知道如何实现同步(非异步)打开页面。
代码示例:
var casper = require('casper').create();
for(i = 1; i < 4; i++) { // I always see the result of 'evaluate', from the last page, but it’s necessary to output from the first and only then, cycle through the second, but these functions are async
casper.start('https://ex.com/?page='+i, function() {
this.echo(this.evaluate(function() {
return document.querySelector('.listBlockInner .title').innerText;
}));
});
}
casper.run();