Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fede-rodes/b28429e994a64b9d7d7378d65dec0395 to your computer and use it in GitHub Desktop.
Save fede-rodes/b28429e994a64b9d7d7378d65dec0395 to your computer and use it in GitHub Desktop.
const cheerio = require('cheerio');
const request = require('request');
request('https://www.cuantocabron.com/ultimos/p/1', (error, response, body) => {
// console.log('error:', error); // Print the error if one occurred
// console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
// console.log('body:', body); // Print the HTML for the Google homepage.
const $ = cheerio.load(body)
// $('h2.title').text('Hello there!')
// $('.apple', '#fruits').text()
// $('h2').addClass('welcome')
const storyTitles = $('h2.storyTitle').html();
console.log(storyTitles);
// $.html()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment