Skip to content

Instantly share code, notes, and snippets.

@sputnick-dev
Created January 23, 2018 14:59
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 sputnick-dev/7f029df82dc8947629aad3d338914ecf to your computer and use it in GitHub Desktop.
Save sputnick-dev/7f029df82dc8947629aad3d338914ecf to your computer and use it in GitHub Desktop.
var request = require("request");
var cheerio = require("cheerio");
request({
uri: "https://99bitcoins.com/bitcoin-rich-list-top100/#addresses",
}, function(error, response, body) {
var $ = cheerio.load(body);
var obj = {};
$("table.t99btc-rich-list tr").each(function(i, elem) {
if (i > 0 && i <= 100) {
obj[i] = {
"hash": $(this).find('td a').text(),
"balance": $(this).find('td:nth-of-type(3)').text()
}
} else if (i === 101) return console.log(JSON.stringify(obj, null, 4));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment