Created
April 13, 2019 08:21
-
-
Save markroxor/edf86b5c8ce55fda25593784c477d670 to your computer and use it in GitHub Desktop.
Calculates net usage by Excitel broadband services.
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 bs4 import BeautifulSoup | |
with open('Excitel.htm', 'r') as f: | |
html = f.read() | |
parsed_html = BeautifulSoup(html, "lxml") | |
total_usage = 0 | |
for i, a in enumerate(parsed_html.findAll('table')[0].findAll('td')): | |
if i % 6 == 4: | |
usage = float(a.text.split()[0]) | |
total_usage += usage | |
print('Total usage - ' + '%.2f' % (total_usage / 1024) + 'GB') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment