Results 1 to 8 of 8

Thread: Retrieving the date of a web page

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    5

    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.

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Retrieving the date of a web page

    To get the last modified date of a file you can use this.

    VB Code:
    1. DEbug.Print Inet1.GetHeader ("Last-modified")

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    5

    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.

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Retrieving the date of a web page

    This works for me
    VB Code:
    1. Inet1.URL = "http://www.yoursite.com/yourfile.zip"
    2.  
    3. Debug.Print Inet1.GetHeader("Last-modified")

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    5

    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...

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    5

    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!

  7. #7
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    5

    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
  •  



Click Here to Expand Forum to Full Width