Currently Browsing

Posts Tagged ‘ selecting element ’

How to select an element from table if there is no ID

When we want to select a value from a table but the element doesn’t have id or other identification, we can use the other cells of the table to identify the value.

For example:


<table id="business_marketData_items" summary="Current market values for major international indexes">
<td><a href="">Dow Jones</a></td>
<td><a href=""> Nasdaq</a></td>

There is a table with stock market data and we want to get the value of the percentage of change (the last column). The percentage doesn’t have any identification, but we know the name of the stock market. For example we choose Dow Jones and the desired value is 0.72%.

How to get the value?