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

Posted on 2006-04-29
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">
                            <td colspan="5"><img src="a.gif" width="249" height="21"></td>
                            <td colspan="5"><img src="a.gif" width="1" height="1"></td>
                          <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>

Thanks a bunch
Question by:JohnDoeSr
    1 Comment
    LVL 4

    Accepted Solution

    txtStats.Text = WebBrowser1.Document.getElementsByTagName("table").Item(15).rows(2).cells(0).innertext

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    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…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now