Good point. Added error checking.
44 karma · joined June 26, 2016
I agree that there are flaws with this as zlagen said (where the page is different in some other parts of HTML).
I've made this according to my need, and that was to check a page for only one number change, where everything else wasn't changing. This is meant to demonstrate general idea behind making something like this.
nemo1618, I agree that code should handle errors and you should definitely do that. For printing out old vs new version, as I said, for my needs, that wasn't needed since I just wanted to get emailed once one number on page changes.