exports.index = function(req, res){ var Crawler = require("crawler").Crawler;
var c = new Crawler({ "maxConnections":10, "debug":true, "forceUTF8":true, // This will be called for each crawled page "callback":function(error,result,$) {
// $ is a jQuery instance scoped to the server-side DOM of the page
var te=$("#top .gengxin table tr:first").html();
console.log(te);
res.render('index',{title:te});
}
}); c.queue("http://psv.tgbus.com"); };
后台输出: GET http://psv.tgbus.com ... Got http://psv.tgbus.com (107044 bytes)... forceUTF8 true Detected charset windows-1252 (95% confidence)
茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆寐济柯矫柯矫柯矫柯矫陆茂驴陆寐柯矫柯矫柯矫柯?nbsp;茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆茂驴陆寐济柯矫柯矫柯矫柯矫柯矫柯矫柯?/font>03-14难道是 windows-1252编码不支持吗?我抓取utf-8的网页是正常的。。