|
-
Sep 15th, 2006, 06:48 AM
#1
Thread Starter
New Member
Retrieving the date of a web page
Hi all,
I want to retrieve the date(s) of a URL, when it was created, etc.
The idea is to automatically know if any changes have been made. I'm now using the Inet Control to download the page every day and compare it to a previously saved version, but I really think it's a bit of a waste of time.
Any ideas would be appreciated. Thanks in advance.
Maikell.
-
Sep 15th, 2006, 06:57 AM
#2
Re: Retrieving the date of a web page
To get the last modified date of a file you can use this.
VB Code:
DEbug.Print Inet1.GetHeader ("Last-modified")
-
Sep 18th, 2006, 03:43 AM
#3
Thread Starter
New Member
Re: Retrieving the date of a web page
mm, this looks as if it should work. However, I keep getting a #35756 error ("can't finish operation/petition"... I don't work in english...)
Can it be that the page doesn't have that precise tag in the header (or it's called some other way)? Is there a way to retrieve all header's tags? I'm trying with www.vbforums.com, for example.
-
Sep 18th, 2006, 04:06 AM
#4
Re: Retrieving the date of a web page
This works for me 
VB Code:
Inet1.URL = "http://www.yoursite.com/yourfile.zip"
Debug.Print Inet1.GetHeader("Last-modified")
-
Sep 18th, 2006, 05:03 AM
#5
Thread Starter
New Member
Re: Retrieving the date of a web page
May have something to do with the regional settings... I work in spanish...
Do you know how I can get a list of the headers' tags? I guess "Last-modified" may translante as "Ultima-modificacion" or something like that...
-
Sep 18th, 2006, 10:49 AM
#6
Thread Starter
New Member
Re: Retrieving the date of a web page
OK, it seems it was just that you need to
Inet1.Execute , "GET"
before you can get the header info. I still wonder where to find a list of all the info the header can give me, but it's ok.
Thank you so much for your help!
-
Sep 18th, 2006, 11:42 PM
#7
Re: Retrieving the date of a web page
From MSDN....HTH
The GetHeader method is used to retrieve header text from an HTTP file.
Syntax
object.GetHeader (hdrName)
The GetHeader method syntax has these parts:
Part Description
object Anobject expression that evaluates to an object in the Applies To list.
hdrName Optional. A string that specifies the header to be retrieved.
Return Type
String
Remarks
If no header is named, all of the headers will be returned.
The table below shows some of the typical headers available.
Header Description
Date
Returns the time and date of the document's transmission. The format of the returned data is Wednesday, 27-April-96 19:34:15 GMT.
MIME-version
Returns the MIME protocol version, which is currently 1.00.
Server
Returns the name of the server.
Content-length
Returns the length in bytes of the data.
Content-type
Returns the MIME Content-type of the data.
Last-modified
Returns the date and time of the document's last modification. The format of the returned data is Wednesday, 27-April-96 19:34:15 GMT.
-
Sep 21st, 2006, 07:22 AM
#8
Thread Starter
New Member
Re: Retrieving the date of a web page
You're the man, Lintz Thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|