Answer the question
In order to leave comments, you need to log in
How to load urls one by one from an array in casperjs?
I make a function on Casper, opened the page, pressed the button, displayed the result.
I'm testing on windows and I'm confused by the starting pause before loading / rendering the 1st page, the second one is loaded immediately.
I understand that he spends time on the start of the program.
I’m thinking about how to iterate through the array of urls that I will pass and open the page, click, display one by one
casper.start('стартовый урл', function (response) {
var av = list.split(',');
for (i=0; i< av.length; i++){
this.echo(av[i]);
this.thenOpen('https://url/'+av[i],function () {
takeShot(); // делаю скриншот1
this.click('a.a2');
takeShot(); // делаю скриншот2
});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question