Skip to content

Instantly share code, notes, and snippets.

@rayriffy rayriffy/index.js Secret
Created Feb 7, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.