Last active
May 26, 2017 14:01
-
-
Save JonFranchi/a3823cf81610bf62866c09099b54a271 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 rpn = require('request-promise-native') | |
const cheerio = require('cheerio') | |
// define our headers | |
const options = { | |
headers: {'user-agent': 'node.js'} | |
} | |
rpn('https://mondotees.com/collections/archive/Posters?page=1', options) | |
.then(function (response) { | |
// create our Jquery world be setting the response = to | |
const $ = cheerio.load(response) | |
// log a sample of our returned data | |
console.log($('title').text()) | |
}).catch(function (error) { | |
// define a promise catch in case it failed along the way | |
console.log('Promise Error:', error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment