CasperJs - Как открыть синхронизацию страниц? - PullRequest
0 голосов
/ 10 апреля 2019

Не могу понять, как реализовать синхронизацию (не асинхронность) открытия страниц.

Пример кода:

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