1 var cheerio = require("cheerio"); 2 var request = require('request'); 3 var iconv = require('iconv-lite'); 4 5 request.get({url:'http://mil.news.sina.com.cn/2015-07-21/1454835521.html',encoding:null},function(error,response,body){ 6 var html = iconv.decode(body, 'gb2312'); 7 console.log(html); 8 $ = cheerio.load(body,{decodeEntities: false}); 9 // console.log($("#artibody").html()); 10 11 12 });
版权声明:除特别声明外,本站所有文章皆是本站原创,转载请以超链接形式注明出处!