Results 1 to 2 of 2

Thread: How do you read html source?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Earth, Solar System, Universe, God's creation
    Posts
    3

    Exclamation How do you read html source?

    Hi,

    Can anyone please write a sample program for me telling how to read html sourcecode? I get really confused when people just give a function and nothing else cause I dont know too much.

    Thanks
    Ore naresome migoto redi-zu (^_^)
    Ore kiru sore hanpatsu!!!

  2. #2
    Matthew Gates
    Guest
    You can do it through a few ways.

    1) MSInet Control (not reliable)
    2) Winsock
    3) URLDownloadToFile API function
    4) WebBrowser Control:


    Code:
    Private Sub Command1_Click()
        Text1.Text = WebBrowser1.Document.DocumentElement.innerHTML
    End Sub

    4a)


    Code:
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Private Function GetHTML(site As String) As String
        Dim IE As Object
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Navigate (site)
        Do While IE.busy = True
            Sleep 500
        Loop
        GetHTML = IE.Document.body.innerhtml
        Set IE = Nothing
    End Function
    
    
    Usage
    
    
    Private Sub Command1_Click()
        Text1.Text = GetHTML("http://www.vb-world.net")
    End Sub

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