html - Finding the XPath for a few rows in a Table? -
i'm attempting pull in specific data html site using xpath queries, i'm having trouble pulling in specific parts.
using //div[@id='main']/h2
xpath query able pull "view current" text using following:
examplesite.title = [[element firstchild] content];
however pull in following:
1. <b>5/9/2013<nbsp><nbsp> 10:58:45 pm</b> 2. <b>6.32</b> 3. <b>5 total points</b> 4. <b>3.72</b>
so far i've got this: //div[@id='main']/table[@class='bodytext']/tr
that's stuck. appreciated! thank you!
here html i'm attempting scrape:
<div id="main"> <h2>view current</h2> <table width="96%" border="0" cellpadding="4" cellspacing="0" bordercolor="#eeeeee" align="center" height="276" valign="top" class="bodytext"> <tr valign="top" > <td colspan = 2 height="13" valign="top" align="left" width="54%" class="headerblue" >balances <br> </td> </tr> <tr valign="top" > <td colspan = 2 height="13" valign="top" align="left" width="54%" class="text" >balances of: <b>5/9/2013<nbsp><nbsp> 10:58:45 pm</b></td> </tr> <tr valign="top" > <td colspan = 2 height="13" valign="top" align="left" width="46%" class="text" >account number: <b>101010123</b></td> </tr> <tr valign="top" > <td colspan = 2 height="13" valign="top" align="left" width="46%" class="text" ></td> </tr> <tr valign="top" > <td height="13" valign="top" align="left" width="46%" class="text" >example card amount: <b>6.32</b></td> <td height="13" valign="top" align="left" width="46%" class="text" ><a href="balance.asp?">view details</a></td> </tr> <tr valign="top" > <td height="13" valign="top" align="left" width="46%" class="text" >example dining plans:<b>5 total points</b> </td> <td height="13" valign="top" align="left" width="46%" class="text" ><a href="balance2.asp?">view details</a></td> </tr> <tr valign="top" > <td height="13" valign="top" align="left" width="46%" class="text" >credit printing: <b>3.72</b></td> <td height="13" valign="top" align="left" width="46%" class="text" ><a href="balance1.asp?">view details</a></td> </tr> <td colspan = 2 height="13" valign="top" align="center" class="text">for questions contact cashiers at<br> (000)000-0011 or <a href="mailto:example@example.com">example@example.com</a></td> </tr> <tr valign="top"> <td colspan = 2 height="13" valign="top" align="center" class="text" > <a href="balance1.asp">all plan usage last 90 days available here</a> </td> </tr> <tr valign="top"> <td colspan = 2 height="13" valign="top" align="center" class="text" > <a href="balance.asp?pln=full">all usage last 365 days available here</a> </td> </tr> </table> </div>
//div[@id='main']/table[@class='bodytext']/tr/td/b
should give list of <b>
s in table cells.
Comments
Post a Comment