We help IT Professionals succeed at work.
Get Started

reading html tag data

Mike Eghtebas
Last Modified: 2015-02-25
I have a source file with two tables:

<table    with this property -->  summary="System Information"

In this table there are unknown number of <td> tags with pair caption/values like "System Name"/"ABC" etc.

<table  The other table has -->  summary="System Data"

again with unknown number of rows in two columns.

In this question the focus is to handle the first table.

Question: How can I read the data from the first table which has property --> summary="System Information"?

I suppose there needs to be some sort of loop to cycle through all the <td> tags to read their caption/ value pair. Below, you can see the sample html.
<table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber4" summary="System Information">
       <td width="28%" height="19"><b><font face="Arial" size="2">DataCaption1 :</font></b></td>
       <td width="34%" height="19"><font size="2">Data1   </font></td>

      <td width="21%" height="19"><b><font face="Arial" size="2">DataCaption2 :</font></b></td>
      <td width="17%" height="19"><font size="2">Data2   </font></td>
    <td width="28%" height="14"><b><font face="Arial" size="2">DataCaption3 :</font></b></td>
    <td width="34%" height="14"><font size="2">Data3</font></td>

    <td width="21%" height="14"><b><font face="Arial" size="2">DataCaption4 :</font></b></td>
    <td width="17%" height="14"><font size="2">Data4 </font></td>
    <td width="28%" height="1"><b><font face="Arial" size="2">DataCaption5 :</font></b></td>
    <td width="34%" height="1"><font size="2">Data5</font></td>

    <td width="21%" height="1"><b><font face="Arial" size="2">DataCaption6 :</font></b></td>
    <td width="17%" height="1"><font size="2">Data6 </font></td>
    <td width="28%" height="8"><b><font face="Arial" size="2">DataCaption7 :</font></b></td>
    <td width="34%" height="8"><font size="2">Data7</font></td>

    <td width="21%" height="8"><b><font face="Arial" size="2">DataCaption8 :</font></b></td>
    <td width="17%" height="8"><font size="2">Data8</font></td>
    <td width="28%" height="1"><font face="Arial" size="2"><b>DataCaption9 :</b></font></td>
    <td width="34%" height="1"><font size="2">Data9</font></td>

    <td width="23%" height="1"><font face="Arial" size="2"><b>DataCaption10 :</b></font></td>
    <td width="15%" height="1"><font size="2">Data10</font></td>

Open in new window

Watch Question
Most Valuable Expert 2013
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE