Skip to content

Instantly share code, notes, and snippets.

@bmorelli25
Created August 1, 2017 14:14
Show Gist options
  • Save bmorelli25/4d5ba59c56c1bfa0c1dddfa5ddb66882 to your computer and use it in GitHub Desktop.
Save bmorelli25/4d5ba59c56c1bfa0c1dddfa5ddb66882 to your computer and use it in GitHub Desktop.
web scraping with Node.js Boilerplate
const rp = require('request-promise');
const cheerio = require('cheerio');
const options = {
uri: `https://www.google.com`,
transform: function (body) {
return cheerio.load(body);
}
};
rp(options)
.then(($) => {
console.log($);
})
.catch((err) => {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment