def check_changes(): # HTML from website req = requests.get('https://grossdomesticproduct.com') web_text = req.text # Saved HTML try: file = open('grossdomesticproduct.html') file_text = file.read() file.close() except FileNotFoundError: file_text = '' # file doesn't exist yet, no problem if web_text != file_text: # Update file with changes file = open('grossdomesticproduct.html','w+') file.write(web_text) file.close() return True, 'BANKSY! ✨ grossdomesticproduct.com has changed!' return False, 'No changes to grossdomesticproduct.com. 😪'