CasperJs-如何打开页面同步?

时间:2019-04-10 13:47:24

标签: phantomjs casperjs

我不知道如何实现同步(非异步)打开页面。

代码示例:

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();

0 个答案:

没有答案