Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要制作一个脚本,当网站发生更改时会通知我。我不确定解决这个问题的最佳方法,我不知道 python 有什么有用的。任何朝着正确方向的推动都会有所帮助。
您可以使用远程页面的最后修改日期:
import urllib u = urllib.urlopen("http://www.google.com") u.info().get("last-modified")
这完全取决于您对网站更新的定义。
最简单的解决方案是使用urllib2获取给定网站的内容,将其存储在一个变量中,然后再次查询该网站的内容并进行比较。
让它在无限循环中运行,你就设置好了。