I have this script
var i=0;
casper.start('http://www.example.com');
casper.then(function() {
this.sendKeys('#search_field', i);
this.click('input.vtop')
});
casper.then(function() {
description = this.fetchText('h2').trim();
description_longue = this.fetchText('#parent-longtext-body').trim();
price = this.fetchText("td.nowrap strong").trim();
})
casper.then(function() {
this.capture('site'+'i'+'.png');
});
casper.viewport(1024, 768);
casper.run();
I want to loop i from 0 to 5. How do I do that?
simple for(i=0;i<5;<++)
does not work!