Skip to content

Instantly share code, notes, and snippets.

@shoota
Last active December 31, 2015 20:29
Show Gist options
  • Save shoota/8040292 to your computer and use it in GitHub Desktop.
Save shoota/8040292 to your computer and use it in GitHub Desktop.
pplogが好きすぎてNode.jsでスクレイピングしてみた
var request = require('request'),
cheerio = require("cheerio");
exports.index = function(req, res){
url = 'http://www.pplog.net/u/shoota';
request(url, function (error, response, body) {
if(error) res.send(500);
var $ = cheerio.load(body);
console.log($('body').text());
var text = $(".content-body").text();
console.log(text);
res.send(text);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment