Skip to content

Instantly share code, notes, and snippets.

@aaferrari
Created July 20, 2015 19:02
Show Gist options
  • Save aaferrari/ccfc39f4b00e3aeadee3 to your computer and use it in GitHub Desktop.
Save aaferrari/ccfc39f4b00e3aeadee3 to your computer and use it in GitHub Desktop.
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