Created
July 18, 2018 10:23
-
-
Save fede-rodes/b28429e994a64b9d7d7378d65dec0395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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