nodejs使用Phantomjs爬取动态页面
像刚刚说的, spawn() 方法稍微感觉有点麻烦,使用 execFile() 能够稍稍简化上面的代码。 execFile() 的前三个参数与 spawn() 的三个参数完全一样,不同的是它多了一个 cb 回调函数,看一个例子就知道这个回调函数有什么用了:var execFile = require("child_process").execFile; child = execFile('node', ['main.js', 'helloworld'], null, function (err, stdout, stderr) { console.log(