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>

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.