?
Solved

I need to retrieve text from the from the 16th table on a website

Posted on 2006-04-29
1
Medium Priority
?
179 Views
Last Modified: 2010-07-27
I'm trying to retrieve text on a website. The text I need to retrieve is on the 16th table, 3rd <TR>, 1st <TD>
I need all the text on that TD. It isn't much, maybe 10 digits. I've managed to figure out:

txtStats.Text = WebBrowser1.Document.getElementsByTagName("table").Item(15).children.Item(0).innertext

But this returns the all the text on that entire <TR> (including the 2nd and 3rd <TD>s). I would normally just mid out what I need but the length of the text in the fields change from time to time and there is no "anchor" from which to base the instr off of.  The table is nested within another table. I'm not sure how many tables deep its nested into. This the table in question:

<table width="249" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td colspan="5"><img src="a.gif" width="249" height="21"></td>
                          </tr>
                          <tr>
                            <td colspan="5"><img src="a.gif" width="1" height="1"></td>
                          </tr>
                          <tr align="left">
                            <td width="85" height="21" bgcolor="#1C9FEC"><font color="#ffffff" face="tahoma" style="font-size: 12px"><img src="a.gif" width="5" height="1">THIS IS THE TEXT I NEED TO RETRIEVE</font></td>
                            <td width="1"><img src="a.gif" width="1" height="1"></td>
                            <td width="80" bgcolor="#1C9FEC"><font color="#ffffff" face="tahoma" style="font-size: 12px"><img src="a.gif" width="5" height="1">Some text</font></td>
                            <td width="1"><img src="a.gif" width="1" height="1"></td>
                            <td width="82" bgcolor="#1C9FEC"><font color="#ffffff" face="tahoma" style="font-size: 12px"><img src="a.gif" width="5" height="1">Some text</font></td>
                          </tr>
                        </table>

Thanks a bunch
0
Comment
Question by:JohnDoeSr
1 Comment
 
LVL 4

Accepted Solution

by:
paulgrunner earned 500 total points
ID: 16572308
txtStats.Text = WebBrowser1.Document.getElementsByTagName("table").Item(15).rows(2).cells(0).innertext
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question