Skip to content

Instantly share code, notes, and snippets.

@thurask
Last active May 22, 2017 16:07
Show Gist options
  • Save thurask/5170dd7532b5049ac862a61f4abe1d07 to your computer and use it in GitHub Desktop.
Save thurask/5170dd7532b5049ac862a61f4abe1d07 to your computer and use it in GitHub Desktop.
Check for Telus software updates
import requests as rq
from bs4 import BeautifulSoup as bs
def grab_telus():
req = rq.get("https://forum.telus.com/t5/Mobility/Software-Update-Schedule/ta-p/53566")
soup = bs(req.text, "html.parser")
tab = soup.find("table")
trs = tab.find_all("tr")
ths = trs[0].find_all("th")
print("\t\t".join([ths[0].text, "DATE", ths[-1].text]))
for row in trs[1:]:
txs = [x.text for x in row.find_all("td") if x.text != "\xa0"]
print("\t".join(txs))
if __name__ == "__main__":
grab_telus()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment