Created
July 19, 2018 01:32
-
-
Save DanNi0130/6b3ba6f05ad456bf65f458dd6d4cd4c4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 rp = require('request-promise'); | |
const $ = require('cheerio'); | |
const url = 'https://en.wikipedia.org/wiki/George_Washington'; | |
rp(url) | |
.then(function(html) { | |
console.log($('.firstHeading', html).text()); | |
console.log($('.bday', html).text()); | |
}) | |
.catch(function(err) { | |
//handle error | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment