nodejs爬虫

// http.get(url,function(res){

// var html = "";
// // console.log(res.statusCode);
// //res是请求回来的数据存储
// res.on("data",function(chunk){
// html += chunk;
 
// })
// res.on("end",function(){
// var $ = cheerio.load(html);
// // console.log($("#right a"))
// $("#right a").each(function(){
// console.log($(this).attr("href"));
// })
// })

// //cheerio包 nodejs的正则扩展包

// }).on("error",function(err){

// //错误信息处理 err存储错误的信息
// // console.log(err);

// });
原文地址:https://www.cnblogs.com/mengmengya/p/9935763.html