Skip to content

Instantly share code, notes, and snippets.

@aaferrari
Created July 20, 2015 19:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Get total Bitcoin balance from blockexplorer.com
# 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