Last active
April 6, 2020 17:22
-
-
Save dgarcia360/b90595b3839e802d6c9bceeea57beb3f to your computer and use it in GitHub Desktop.
Checks if some NIS1 node has enable historical account data retrieval
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
from urllib.request import Request, urlopen | |
from bs4 import BeautifulSoup | |
PORT = ':7890' | |
ENDPOINT = '/account/historical/get?address=NALICELGU3IVY4DPJKHYLSSVYFFWYS5QPLYEZDJJ&startHeight=17592&endHeight=17592&increment=1' | |
explorer_url = 'https://nemnodes.org/nodes/' | |
req = Request(explorer_url, headers={'User-Agent': 'Mozilla/5.0'}) | |
page_url = urlopen(req).read() | |
soup = BeautifulSoup(page, 'html') | |
table = soup.findAll('table')[1] | |
for table_row in table.select('tr'): | |
cells = table_row.findAll('td') | |
if len(cells) > 0: | |
IP = cells[1].text.strip() | |
try: | |
node_req = Request('http://' + IP + ':' + PORT + ENDPOINT) | |
print (node_req.url) | |
print(urlopen(node_req).read()) | |
except Exception as e: | |
print(e) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment