Created
August 1, 2017 14:14
-
-
Save bmorelli25/4d5ba59c56c1bfa0c1dddfa5ddb66882 to your computer and use it in GitHub Desktop.
web scraping with Node.js Boilerplate
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 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