GetHtmlPageSource – Get the HTML of a page using MSXML library

' Getting the HTML code of any page on the web' NOTE: requires the Microsoft XML library' Example:'    Text1.Text = GetHtmlPageSource("")Function GetHtmlPageSource(ByVal URL As String)    Dim objHTTP  As New XMLHTTP    ' add the http:// in case it isn't already present in the specified URL    If Left$(URL, 7) <> "http://" Then URL = "http://" & URL        ' open the page in sync mode "GET", URL, False    objHTTP.send    ' check the result of the operation    If objHTTP.Status = "200" Then        GetHtmlPageSource = objHTTP.responseText    End IfEnd Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: