I am currently trying to get a spot in a zoom class, and if I don't get a spot I owe a driving school 300 dollars. Long story there, but not very important. I am trying to get a notification if the zoom registration link data has been updated. I originally tried to just see if the hash of the site was updated at any point, but I noticed there must be some internal clock that is changed, making it notify me every minute. The specific element I am looking to see if it is removed is...
<div class="form-group registration-over">Registration is closed.</div>
I am not sure how to isolate it within the hash. Below is the code I have for checking for any update.
import time
import hashlib
from urllib.request import urlopen, Request
import webbrowser
url = Request('URL HERE',
headers={'User-Agent': 'Mozilla/5.0'})
response = urlopen(url).read()
currentHash = hashlib.sha224(response).hexdigest()
print("running")
time.sleep(10)
while True:
try:
response = urlopen(url).read()
currentHash = hashlib.sha224(response).hexdigest()
time.sleep(30)
response = urlopen(url).read()
newHash = hashlib.sha224(response).hexdigest()
if newHash == currentHash:
continue
else:
from datetime import datetime
now = datetime.now()
nowtime = now.strftime("%H:%M:%S: ")
print(nowtime, "Something changed")
webbrowser.open('URL HERE')
response = urlopen(url).read()
currentHash = hashlib.sha224(response).hexdigest()
time.sleep(30)
continue
except Exception as e:
print("error")