2016-11-03 4 views
0

Ich bin neu mit CasperJS. Ich versuche, einen externen Befehl mit Casper aufzurufen, aber nichts erscheint in der Konsole. Ich benutze Windows 7. Hast du eine Idee? Dies ist der Code:CasperJS + PhantomJS Kind Prozess funktioniert nicht auf Windows 7

var casper = require('casper').create(); 

casper.then(function() { 
var process = require("child_process") 
var spawn = process.spawn 
var execFile = process.execFile    

var child = spawn("cmd.exe", ["/k","dir"]) 

child.stdout.on("data", function (data) { 
    console.log("spawnSTDOUT:", JSON.stringify(data)) 
}) 

child.stderr.on("data", function (data) { 
    console.log("spawnSTDERR:", JSON.stringify(data)) 
}) 

child.on("exit", function (code) { 
    console.log("spawnEXIT:", code) 
}) 
});  

casper.run(); 

Dank

+1

Mögliche Duplikat [Warten Sie für ein Kind Prozess in CasperJS] (http://stackoverflow.com/questions/29253690/wait-for-a-child-process-in-casperjs) – Vaviloff

Antwort

Verwandte Themen