Skip to content

Instantly share code, notes, and snippets.

@JonFranchi
Last active May 26, 2017 14:01
Show Gist options
  • Save JonFranchi/a3823cf81610bf62866c09099b54a271 to your computer and use it in GitHub Desktop.
Save JonFranchi/a3823cf81610bf62866c09099b54a271 to your computer and use it in GitHub Desktop.
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