javascript - Call shell command within PhantomJS -
i wonder how run shell command within phantomjs, homecoming result of execution , assign variable.
e.g. there phantomjs script:
var spawn = require("child_process").spawn var execfile = require("child_process").execfile var kid = spawn("/usr/bin/php", ["script.php"]) child.stdout.on("data", function (data) { console.log(json.stringify(data)) }) and simple php script:
<?php echo "test"; ?> this illustration prints console "test", how utilize returned data? possible assign variable , utilize in next phantomjs steps?
javascript phantomjs casperjs headless-browser
No comments:
Post a Comment