由于您正在使用Webkit浏览器内置的PhantomJS,因此可以访问本机JSON库。无需使用page.evaluate,您只需在page对象上使用plainText属性即可。
http://phantomjs.org/api/webpage/property/plain-
text.html
var page = require('webpage').create();page.open('http://somejsonpage.com', function () { var jsonSource = page.plainText; var resultObject = JSON.parse(jsonSource); phantom.exit();});


