Results 1 to 3 of 3

Thread: Downloading a Webpage into a file

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Torbay, Newfoundland, Canada
    Posts
    1

    Question Problem with Inet

    Hi
    I'm pretty new to VB. I've been trying to use code similar to this to download a webpage and put it into a file.

    Dim b() As Byte

    Inet1.Protocol = icHTTP
    Inet1.URL = URL

    b() = Inet1.OpenURL(Inet1.URL, icByteArray)

    Open App.Path + "\filename" For Binary Access Write As #1
    Put #1, , b()
    Close #1

    My problem is that I'm getting a "Variable Not Defined" error for Inet1. Does anyone know how to fix this?
    Thanx.
    Last edited by pcrowley; May 9th, 2001 at 12:18 PM.

  2. #2
    Junior Member
    Join Date
    May 2001
    Location
    Finland
    Posts
    26
    Hi,

    don't know what is wrong with your code. But te following works for me. It downloads a web page and saves it to disk HTML formatting included.

    Hope it's of help.
    Eero

    Dim StrUrl As String
    intFile = FreeFile()
    StrUrl = "http://www.msn.com/"
    Open "c:\temp\MSsource.txt" For Output As #intFile
    Write #intFile, Inet1.OpenURL(StrUrl)
    Close #intFile

  3. #3
    Matthew Gates
    Guest
    Take a look at this link for download web pages as well.
    http://www.vbworld.com/tips/tip501.html

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