Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I read a web page from VB

Status
Not open for further replies.

MacroManII

Programmer
Nov 14, 2002
22
US
Hi,

Does anyone have a simple example in VB of how I could
open a web page, and download a table from it.

Regards

MacroManII
 
I don't have sample code available at the moment, but this will get you started:

use either the INET or WEBBROWSER control to return the html for the page. This will then be held in one string variable.

You can either:

Use a GetElementsByTag function to return all tags called TABLE

OR

Use a split function to seperate the HTML string into an array, using "<table" as the delimiter. THis will seperate each table into a new arrray.

Next, find only those array objects, which include both "<table" and "</table" strings. If they only contain one of these, then the array only holds the outer table, containing a nested table.

Finally, use INSTR to search the array for "</table", and return everything to the left of this, as the contents of the table.

Hope this helps. Back in the office tomorrow where I may have some source code available.

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top