I downloaded many pages html with casperjs, but I want separate them in 2 folders. some files contains id="trie" and others not.
What can I do, please?
this is my script
casper.repeat(j , function(){
casper.open(arrdata[i]); // arrdata[i] : contains url of file to download
casper.wait(5000, function(){
file = 'pages/road/r_' + i +'.html';
fs.write(file, casper.getHTML(), 'w');
});
i++;
});
but i want do like this
casper.repeat(j, function(){
casper.open(arrdata[i]);
if ("id=trie" exists in contains of arrdata[i] ){
this file is put to pages/trie/...html
} else {
this file is put to pages/road/...html
}
i++;
});