Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2010 Using MSXML2.XMLHTTP to read table from webpage

$
0
0
I have tried to use a webbrowser in my VB program to load a web page and the table on the web page. It works but VERY slowly and a lot of the time it freezes.
I found some sample code that reads the web page without a web browser. It reads the text on the web page and puts it into a Rich Text Box called WebText.
This code works really quick and never locks up but it does not read the text that is in the table on the webpage.

The code I am using calls the function below:

WebText.Text = GetHTMLCode("http://xfinitytv.comcast.net/tv-listings")


Function GetHTMLCode(ByVal strURL) As String
Dim strReturn ' As String
Dim objHTTP ' As MSXML.XMLHTTPRequest
If Len(strURL) = 0 Then Exit Function
objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.open("GET", strURL, False)
objHTTP.send() 'Get it.
strReturn = objHTTP.responseText
objHTTP = Nothing
GetHTMLCode = strReturn
End Function

I am new to programming (hoping to get better with time). If I write something that sounds like I do not know what I am talking about it is probably because I don't. Any help would be appreciate.

Thanks,
Chris

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>