954,178 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to write this kind of xpath exprssion?

there is table :
reportdate
10/31/09
10/31/08
10/31/07
10/31/06
10/31/05
Cash & Equivalents
2,493
1,429
1,826
2,262
2,251
Receivables
595
770
735
692
753

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

reportdate
10/31/09
10/31/08
10/31/07
10/31/06
10/31/05


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

Receivables
595
770
735
692
753

how to write a xpath expression to get the following?
Cash & Equivalents
2,493
1,429
1,826
2,262
2,251

luofeiyu
Newbie Poster
7 posts since Aug 2010
Reputation Points: 7
Solved Threads: 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

hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 243
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You