Created
January 23, 2018 14:59
-
-
Save sputnick-dev/7f029df82dc8947629aad3d338914ecf 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
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