Skip to content

Commit 94c3787

Browse files
authored
Update MneEthOn_v2.py
1 parent 532512a commit 94c3787

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

MneEthOn_v2.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from hdwallet import BIP44HDWallet
77
from hdwallet.cryptocurrencies import EthereumMainnet as Cryptocurrency
88
from hdwallet.utils import is_mnemonic
9-
from lxml import html
109
from mnemonic import Mnemonic
1110
from multiprocessing import Process
1211
import requests
@@ -40,15 +39,11 @@ def mmdrza() :
4039
addr = bip44_hdwallet.p2pkh_address()
4140
priv = bip44_hdwallet.private_key()
4241
# =======================================
43-
urlblock = "https://ethereum.atomicwallet.io/address/"+addr
42+
urlblock = f"https://ethereum.atomicwallet.io/api/v2/address/{addr}"
4443
respone_block = requests.get(urlblock)
45-
byte_string = respone_block.content
46-
source_code = html.fromstring(byte_string)
47-
xpatch_txid = '/html/body/main/div/div[2]/div[1]/table/tbody/tr[2]/td[2]'
48-
treetxid = source_code.xpath(xpatch_txid)
49-
xVol = str(treetxid[0].text_content())
50-
elapsed = respone_block.elapsed
51-
timer = elapsed
44+
res = respone_block.json()
45+
xVol = dict(res)['balance']
46+
timer = respone_block.elapsed
5247
bal = xVol
5348

5449
# =======================================
@@ -77,4 +72,4 @@ def mmdrza() :
7772
for i in range(len(add)) :
7873
p = multiprocessing.Process(target = mmdrza)
7974
p.start()
80-
p.join()
75+
p.join()

0 commit comments

Comments
 (0)