Results 1 to 2 of 2

Thread: VB - Get HTML Source

  1. #1

    Thread Starter
    Junior Member Bean's Avatar
    Join Date
    Apr 2003
    Location
    GA, USA
    Posts
    23

    VB - Get HTML Source

    I saw a post where someone was looking for a way to grab the HTML source from a website, but I can't find that post to reply, so here's my snippet...(you need a from with an INET control on it)

    Code:
    Private Function GetHTML(url$) As String
    Dim response$
    Dim vData As Variant
    
      Inet1.Cancel
       response = Inet1.OpenURL(url)
      If response <> "" Then
        Do
          vData = Inet1.GetChunk(1024, icString)
          DoEvents
          If Len(vData) Then
            response = response & vData
          End If
        Loop While Len(vData)
      End If
       GetHTML = response
    End Function
    Last edited by Bean; Apr 3rd, 2003 at 02:19 PM.
    Is an IF...MAYBE...THEN... clause TRUE half of the time?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Might I suggest you change the subject line to be a little more descriptive of the snippet.... say, "How to Download Web Page Source"
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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