How to check if content of webpage has been changed?

前端 未结 6 1086
失恋的感觉
失恋的感觉 2020-12-30 11:23

Basically I\'m trying to run some code (Python 2.7) if the content on a website changes, otherwise wait for a bit and check it later.

I\'m thinking of comparing

6条回答
  •  天涯浪人
    2020-12-30 11:57

    Hope this helps.

    store the html files -- two versions..

    one was the html which was taken before an hour. -- first.html

    second is the html which was taken now -- second.html

    Run the command :

    $ diff first.html second.html > diffs.txt
    

    If the diffs has some text then the file is changed.

提交回复
热议问题