-
-
Save rayriffy/d5ef10648d493572aec47e3960663b44 to your computer and use it in GitHub Desktop.
This file contains 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
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