Skip to content

Instantly share code, notes, and snippets.

@rayriffy
Created February 7, 2019 04:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rayriffy/7aa24bdd920c61bd73018b11e8744f49 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($('#contentPrint > div:nth-child(1) > div.title').text())
})
.catch(e => {
console.error(e)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment