I have a CasperJS process that loads some page and then it needs to call a go-process to analyze the page and to decide what page should be loaded next. go-process takes a w
casper.then(function(){
var p = cp.execFile('/path/parse', [], {}, function(error, stdout, stderr) {
console.log(stdout);
casper.thenOpen(parsedUrl).then(function(){
// do something on page
});
});
});
casper.run(function(){});
From my test, capser.run
does not wait for execFile
to finish the job. There is no log gets printed from the execFile
callback. @Artjom B.