Skip to content

Instantly share code, notes, and snippets.

@nasirhm
Created February 1, 2019 14:27
Show Gist options
  • Save nasirhm/4cf7680f588e2867adda7f33e85f9488 to your computer and use it in GitHub Desktop.
Save nasirhm/4cf7680f588e2867adda7f33e85f9488 to your computer and use it in GitHub Desktop.
Medium Article about Web Scraping
const rp = require('request-promise');
const cheer = require('cheerio');
const url = 'https://en.wikipedia.org/wiki/List_of_Presidents_of_the_United_States';
rp(url)
.then(function(data){
//Filtering Tags - Length one is to check there isn't additional Data Coming
console.log(cheer('big > a',data.length));
console.log(cheer('big > a',data))
})
.catch(function(err){
console.log(err);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment