Skip to content

Instantly share code, notes, and snippets.

@rayriffy
Created February 7, 2019 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayriffy/d5ef10648d493572aec47e3960663b44 to your computer and use it in GitHub Desktop.
Save rayriffy/d5ef10648d493572aec47e3960663b44 to your computer and use it in GitHub Desktop.
import cheerio from 'cheerio'
import rp from 'request-promise'
rp({
uri: `https://news.sanook.com/lotto/`,
transform: body => {
return cheerio.load(body)
},
})
.then($ => {
console.log($('#blog').attr('href'))
})
.catch(e => {
console.error(e)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment