PhatomJS
下载地址:http://phantomjs.org/download.html
官方文档:http://phantomjs.org/quick-start.html
第一段代码
var page = require('webpage').create(); //给用户提供了访问、操作、选择web文档的接口 phantom.outputEncoding = 'gbk'; //编码格式 page.open("http://www.cnblogs.com/imaye/",function(status){ if(status=="success") { console.log(page.title); } else{ console.log("open failed"); } phantom.exit(0); //退出phantomjs执行环境 });