Created
July 20, 2015 19:02
-
-
Save aaferrari/ccfc39f4b00e3aeadee3 to your computer and use it in GitHub Desktop.
Get total Bitcoin balance from blockexplorer.com
This file contains hidden or 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
# need BeautifulSoup2 | |
from BeautifulSoup import BeautifulSoup as bs | |
balance=0.0 | |
for direccion in direcciones: | |
sopa = bs(getter("http://blockexplorer.com/address/%s" % direccion)) | |
tabla = sopa.find("table", {"class":"txtable"}) | |
fila = tabla.findAll("tr")[-1] | |
celdas = fila.findAll("td") | |
if celdas != []: | |
balance += float(celdas[-1].string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment