Html 如何知道网页上次更新的时间?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3189454/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to know when a web page was last updated?
提问by Gaurav
How can you detect when somebody else's web page was last updated (or was changed)?
您如何检测其他人的网页上次更新(或更改)的时间?
采纳答案by spoulson
The last changed time comes with the assumption that the web server provides accurate information. Dynamically generated pages will likely return the time the page was viewed. However, static pages are expected to reflect actual file modification time.
上次更改时间假设 Web 服务器提供准确信息。动态生成的页面可能会返回查看页面的时间。但是,预计静态页面会反映实际的文件修改时间。
This is propagated through the HTTP header Last-Modified
. The Javascript trick by AZIRAR is clever and will display this value. Also, in Firefox going to Tools->Page Info will also display in the "Modified" field.
这是通过 HTTP 标头传播的Last-Modified
。AZIRAR 的 Javascript 技巧很聪明,会显示这个值。此外,在 Firefox 中,转到工具->页面信息也将显示在“修改”字段中。
回答by Wassim AZIRAR
01.Open the page for which you want to get the information.
01.打开要获取信息的页面。
02.Clear the address bar [where you type the address of the sites]:
02.清除地址栏[您输入网站地址的地方]:
and type or copy/paste from below:
并从下面键入或复制/粘贴:
javascript:alert(document.lastModified)
03.Press Enter or Go button.
03.按 Enter 或 Go 按钮。
回答by JSB????
In general, there is no way to know when something on another site has been changed. If the site offers an RSS feed, you should try that. If the site does not offer an RSS feed (or if the RSS feed doesn't include the information you're looking for), then you have to scrape and compare.
通常,无法知道其他站点上的某些内容何时发生了更改。如果该站点提供 RSS 提要,您应该尝试一下。如果该站点不提供 RSS 提要(或者如果 RSS 提要不包含您正在寻找的信息),那么您必须进行抓取和比较。
回答by Zararsiz
Take a look at archive.org
You can find almost everything about the past of a website there.
您几乎可以在那里找到有关网站过去的所有信息。