473,675 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using MSXML2 to read a table from a webpage

1 New Member
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("http://xfinitytv.comcast.net/tv-listings")
  2.  
  3.  
  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.         objHTTP.open("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.

Thanks,
Chris
Apr 8 '13 #1
0 867

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

Similar topics

0
5665
by: Ahmed A. | last post by:
This will be very helpfull for many! Using RichTextBox Read/Write Unicode File http://www.microsoft.com/indonesia/msdn/wnf_RichTextBox.as p Private Function ReadFile(ByVal myfile As String) As String Dim myFileStream As Stream = File.Open(myfile, FileMode.Open)
2
1390
by: Loane Sharp | last post by:
Hi there I'm downloading data from a remote server to my local disk using Stream.Read() and Stream.Write() (as previously suggested by Ken Tucker in this group). By and large the download and local write operations occur successfully, but frequently the data transfer is "intermittent", ie. sometimes the connection to the server becomes idle and no data transfer occurs over the wire. The code eventually resumes execution as if all the...
1
1680
by: Juergen Wohnich | last post by:
I want to read a webpage in chart buffer and than i want to parse it. If have found out that "CInternetSession.OpenURL" is the way to do this, but now i seraching for a complete sample. Maybe a sample how to get the first 1000 or 2000 chars of a side into a buffer. Anybody have some link or advice ?
5
1534
by: sck10 | last post by:
Hello, I need to create a Business Rules table that can be pulled into the web page and use it as criteria for who should receive the approval email. For example, I have created a travel request form that ask a series of questions: TravelType: Domestic or International VisitType: (Customer, Internal Meeting, Seminar) TravelCost
1
1805
by: sowmyavenkat | last post by:
hi all, Iam working on a Maintainance and enhancement project. It was developed by somebody. Now there is a bug which is to be solved. Can any body help me to find out which stored procedure is using a particulat table.
1
16675
by: pds79 | last post by:
Hi everyone, I'm a newbie to the forum. I have an issue and was hoping to get some assistance/ideas: Im trying to read a XML file into two record sets. I can acheive looping through the first level element but i can not loop the the second level (child elements), any ideas?? I need to be able to loop thru each patient record and read into rsPatMeals and secondly loop thru each <meal_selected> and read into rsMeals. ---- xml...
16
4777
by: BlackEye | last post by:
Hi all! i want to validate the user name and password using an sql table i created. i have tried the following code: SqlConnection myConnection = new SqlConnection("data source=myPC;database=myDB;uid=abc;password=abc123"); DataSet dsFillData = new DataSet();
3
6259
by: dfordinal | last post by:
I am calling a remote web server and awaiting data that is being passed back to my process in a form variable. postData = "fname=John" Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.4.0") Call xmlHttp.Open("POST", "http://www.webSite.com", false) Call xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") Call xmlHttp.send(postData) Response.ContentType = "text/html" 'Need to get two values from a form.
0
2277
by: Quickzilverfox | last post by:
I am attempting to send a purchase request string to a webservice on a remote site I am able to successfully send the quoterequest using Msxml2.ServerXMLHTTP on one page and parse the response. When I try to send the purchaserequest on the next page to the same URL, I get an "Unable to Parse" error and the POST never leaves my server. Please help! Working POST (quoterequest) <%@ LANGUAGE="VBSCRIPT"%> <!-- #include...
0
8527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8975
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8686
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7506
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4263
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4469
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.