By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Using MSXML2 to read a table from a webpage

P: 1
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:

Expand|Select|Wrap|Line Numbers
  1.     WebText.Text = GetHTMLCode("")
  4.     Function GetHTMLCode(ByVal strURL) As String
  5.         Dim strReturn       ' As String
  6.         Dim objHTTP         ' As MSXML.XMLHTTPRequest
  7.         If Len(strURL) = 0 Then Exit Function
  8.         objHTTP = CreateObject("MSXML2.XMLHTTP")
  9."GET", strURL, False)
  10.         objHTTP.send()                    'Get it.
  11.         strReturn = objHTTP.responseText
  12.         objHTTP = Nothing
  13.         GetHTMLCode = strReturn
  14.     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. Also, I am using VB2010.

Apr 8 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.