A look at business, law and life from a technophile.
Get Last Modified Date from Webpage You’re Visiting
I found a neat little trick that allows me to get a last modified date / last changed date from a webpage I’m viewing.
Simply copy the code below into your address bar and it will cause a window to pop-up with the last modified date.
javascript:alert("Last Modified " + document.lastModified)
Very neat trick.
–Ben
Source: About.com
Probably. I’m not that familiar with sellenium, but you’ll need to have it run the javascript code on each page. I assume it might record what you type in the URL bar, and that might be where I start.
–Ben
This is very helpful but is it possible to implement in java coding using sellenium ?
Actually i want to know that when any website modified last using my java code.
Please Help me for this.
Sorry, it took me a while to comment. The issue is when the file was actually created. If it is a static html page, you will likely see the date of when someone uploaded that file to the server (or changed it).
However, if the file is from a dynamic website (like this wordpress blog), the server is actually creating the file and then serving it to you. Thus the file you just received was created just now.
Caching may complicate this a little bit, so you might see a recent date, rather than a right now date. Caching is where the computer creates a copy of dynamic content that shouldn’t change for a little while. I cache on this website, as I only post every so often.
Moral of the story: The value of this command is going to be less and less useful as websites become more and more responsive to user interaction and the rise of Content Management Systems (CMS), and less and less static html.
I think sunny is saying the same thing I am seeing. Some web pages show the apparent date of last modification but others show the current date and time. This must have to do with how the web pages are loaded and whether they are static and only loaded when they are changed (on demand) or some open system that reloads frequently. Sorry I am not very smart.
Thanks for the trick.
But, it is only working for html pages. I tried it over wordpress and it shows current date
Thanks so much for this tip! It works so well!