0

there is table :
<table>
<tr bgcolor="F3F3F3">
<td align="right" width="240" class="tickerSm">reportdate</td>
<td align="right" width="65" class="tickerSm">10/31/09</td>
<td align="right" width="65" class="tickerSm">10/31/08</td>
<td align="right" width="65" class="tickerSm">10/31/07</td>
<td align="right" width="65" class="tickerSm">10/31/06</td>
<td align="right" width="65" class="tickerSm">10/31/05</td>
</tr>
<tr bgcolor="ffffff">
<td class="tickerSm">Cash & Equivalents</td>
<td align="right" class="ticker">2,493</td>
<td align="right" class="ticker">1,429</td>
<td align="right" class="ticker">1,826</td>
<td align="right" class="ticker">2,262</td>
<td align="right" class="ticker">2,251</td>
</tr>
<tr bgcolor="ffffff">
<td class="ticker">Receivables</td>
<td align="right" class="ticker">595</td>
<td align="right" class="ticker">770</td>
<td align="right" class="ticker">735</td>
<td align="right" class="ticker">692</td>
<td align="right" class="ticker">753</td>
</tr>
</table>

xpath('//table/tr[td[@class="tickerSm"]') can get:

<tr bgcolor="F3F3F3">
<td align="right" width="240" class="tickerSm">reportdate</td>
<td align="right" width="65" class="tickerSm">10/31/09</td>
<td align="right" width="65" class="tickerSm">10/31/08</td>
<td align="right" width="65" class="tickerSm">10/31/07</td>
<td align="right" width="65" class="tickerSm">10/31/06</td>
<td align="right" width="65" class="tickerSm">10/31/05</td>
</tr>
<tr bgcolor="ffffff">


xpath('//table/tr[td[@class="ticker"]') can get :

<tr bgcolor="ffffff">
<td class="ticker">Receivables</td>
<td align="right" class="ticker">595</td>
<td align="right" class="ticker">770</td>
<td align="right" class="ticker">735</td>
<td align="right" class="ticker">692</td>
<td align="right" class="ticker">753</td>
</tr>

how to write a xpath expression to get the following?
<tr bgcolor="ffffff">
<td class="tickerSm">Cash & Equivalents</td>
<td align="right" class="ticker">2,493</td>
<td align="right" class="ticker">1,429</td>
<td align="right" class="ticker">1,826</td>
<td align="right" class="ticker">2,262</td>
<td align="right" class="ticker">2,251</td>
</tr>

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by hielo
0

xpath('//table/tr[td[@class="tickerSm"]') can get:
...reportdate

that should be getting your BOTH 'reportdate' and 'Cash & Equivalents' since it too has class="tickerSm"

From what you posted:
xpath('//table/tr[1]) should give you 'reportdate' row
xpath('//table/tr[2]) should give you 'Cash & Equivalents' row
xpath('//table/tr[3]) should give you 'Receivables' row

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.