FalqueDEV FalqueDEV - 5 months ago 59
Node.js Question

Getting data with node.js

so what's i'm looking for it is how to getting this informations (with blue) and print it on my command line application Classement
I tryed this:



var cloudscraper = require('cloudscraper');


cloudscraper.post('https://hbeta.net/', {
username: "Hidden",
password: "Hidden"
}, function(error, response, body) {
if (error) {
console.log("Error");
} else {
console.log(response.statusCode);

cloudscraper.get('hbeta.net/community/classement', function(error, response, body) {
if (error) {
console.log('Error occurred');
} else {
console.log(body);
//here i dont know what to do to get the specific information from the body
}
});
}
});




Answer

In this case, you would do what is called web scraping. cheerio is a node module that would allow you to do that.

You can find a tutorial here