Results 1 to 3 of 3

Thread: Saving WebPages Using VB

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    60
    I need to make an application that picks up all the images and downloadable file in a Web Page using VB6.0. These downloaded items are to be savwed in Folder. How can I do this using Internet Control and Using Webbrowser Control?

  2. #2
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    Actually, you won't need the WebBrowser control unless you want to view the page from your app.

    You will probably want something like a listbox to display all the downloadable items on a page as well as all the images.

    Also, put the inet control on the form, and a button to start and a textbox to specify the location of the page (URL)

    Code:
    '  You should have this:
    '    Form1
    '    Text1
    '    Command1
    '    List1
    '    Inet1
    
    '  Put the following code:
    Private Sub Form_Load()
      Command1.Caption = "GO!"
      Text1.Text = ""
    End Sub
    
    Private Sub Command1_Click()
      Dim sHTML As String
      'Just a little error handling
      If Len(Text1.Text) > 0 Then
        'Set the Target page and get the HTML
        'on that page.
        With Inet1
          .URL = Text1.Text
          sHTML = .OpenURL
        End With
        'sHTML now contains the HTML for the
        'WHOLE page.
    
        'Here you'll parse sHTML for links to images and
        'downloadable files and add the links to the listbox.
    
        'To download the files, you will say:
        Dim b() as Byte
        b() = Inet1.OpenURL(Text1.Text, icByteArray)
        'Then
        Open "myfile" for binary as #1
        Put #1,,b()
        Close #1
      End If
    End Sub
    Quite simple, but saving pictures in this way takes a long time. I dunno how to get it quicker.

    r0ach™
    Don't forget to rate the post

  3. #3
    Guest
    You could also download files automatically.

    Take a look at this link.
    http://www.vb-world.net/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