Skip to content

Instantly share code, notes, and snippets.

@h4ck3rm1k3
Created January 27, 2018 10:18
Show Gist options
  • Save h4ck3rm1k3/899edf52193dfa059e259abf31d98439 to your computer and use it in GitHub Desktop.
Save h4ck3rm1k3/899edf52193dfa059e259abf31d98439 to your computer and use it in GitHub Desktop.
binance balance parser
#!/usr/bin/python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import pprint
# go to https://www.binance.com/userCenter/balances.html and save the file as the name below
with open("Deposits ​Withdrawals-Binance.com.html") as fp:
soup = BeautifulSoup(fp,'lxml')
#<div class=>
print '|'.join(['coin','fullname', 'total'])
print '|'.join(['----','--------', '-----'])
for d in soup.find_all("div", { 'class' : 'coin'}):
dp = d.parent
#print(d.parent.prettify())
#for d2 in d :
# print d2
o = {}
for n in ('fullName',
'coin',
'usable',
'total',
'locked',
'btn-deposit',
'equalValue'):
#print n
for e in dp.find_all('div', { 'class' : n}):
o[n]= e.text.replace("\n",'')
#for e2 in e:
# print e2
if o['coin'] == 'Coin' :
continue
#if o['total'] == '0.00000000':
print '|'.join([o['coin'],o['fullName'], o['total']])
coin fullname total
ADA Cardano 39.89700000
CND Cindicator 24.98000000
SNGLS SingularDTV 21.97800000
IOTA MIOTA 18.58200000
IOST IOStoken 9.99000000
AMB Amber 2.99700000
QSP Quantstamp 2.00000000
MOD Modum 1.99800000
WABI WaBi 1.99800000
AST AirSwap 1.99800000
TNT Tierion 1.99800000
EOS EOS 1.09890000
XVG Verge 1.00000000
TNB Time New Bank 1.00000000
OAX openANX 1.00000000
DNT district0x 1.00000000
ARN Aeron 1.00000000
CDT CoinDash 1.00000000
RDN Raiden Network Token 1.00000000
LEND EthLend 1.00000000
WINGS WINGS 1.00000000
LRC Loopring 1.00000000
NULS Nuls 1.00000000
YOYO YOYOW 1.00000000
TRX TRON 1.00000000
CMT CyberMiles 1.00000000
SNT Status 1.00000000
RCN Ripio Credit Network 1.00000000
KNC KyberNetwork 1.00000000
SNM SONM 1.00000000
FUN FunFair 1.00000000
LINK ChainLink 1.00000000
APPC AppCoins 1.00000000
POE Po.et 1.00000000
BAT Basic Attention Token 1.00000000
MDA Moeda Loyalty Points 1.00000000
BCPT BlockMason Credit Protocol 1.00000000
SUB Substratum 1.00000000
ADX AdEx 1.00000000
MANA Decentraland 1.00000000
MTH Monetha 1.00000000
ENG Enigma 1.00000000
BRD Bread 1.00000000
FUEL Etherparty 1.00000000
ELF aelf 1.00000000
DLT Agrello 1.00000000
REQ Request Network 1.00000000
VIB Viberate 1.00000000
POWR PowerLedger 1.00000000
BTS BitShares 1.00000000
XRP Ripple 1.00000000
GTO Gifto 1.00000000
ENJ EnjinCoin 1.00000000
STORJ Storj 1.00000000
ICN ICONOMI 0.99900000
EVX Everex 0.99900000
QTUM Qtum 0.99900000
XLM Stellar Lumens 0.99900000
ZRX 0x 0.99900000
CTR Centra 0.99900000
OST Simple Token 0.99900000
VIBE VIBE 0.99900000
INS INS Ecosystem 0.99900000
VEN VeChain 0.99900000
BQX ETHOS 0.99800000
BNB Binance 0.54817585
LSK Lisk 0.10990000
ARK Ark 0.10000000
MTL Metal 0.10000000
GVT Genesis Vision 0.09990000
ETH Ethereum 0.06130697
DGD DigixDAO 0.04095900
XZC ZCoin 0.02000000
OMG OmiseGO 0.01000000
BTG Bitcoin Gold 0.01000000
RLC iExecRLC 0.01000000
BNT Bancor 0.01000000
ETC Ethereum Classic 0.01000000
SALT Salt 0.01000000
PPT Populous 0.01000000
STRAT Stratis 0.01000000
NEO NEO 0.01000000
WTC Walton 0.01000000
XMR Monero 0.01000000
MCO MONACO 0.01000000
GXS GXShares 0.01000000
TRIG Triggers 0.01000000
WAVES Waves 0.01000000
HSR Hshare 0.01000000
NAV NAV Coin 0.01000000
ICX ICON 0.01000000
KMD Komodo 0.01000000
EDO Eidoo 0.01000000
AION AION 0.01000000
LTC Litecoin 0.01000000
NEBL Neblio 0.01000000
GAS NeoGas 0.01000000
LUN Lunyr 0.01000000
PIVX PIVX 0.00999000
BTC Bitcoin 0.00194738
BCD Bitcoin Diamond 0.00100000
DASH Dash 0.00100000
BCC Bitcoin Cash 0.00100000
ZEC Zcash 0.00100000
ETF ETF 0.00000000
BTM Bytom 0.00000000
USDT TetherUS 0.00000000
HCC HealthCare Chain 0.00000000
BCX BitcoinX 0.00000000
LLT LLToken 0.00000000
SBTC Super Bitcoin 0.00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment