Get total Bitcoin balance from blockexplorer.com
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
# 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