c# - Failing to retrieve the third td nodes in an html list -
i trying text "very country views" , "good" using htmlagilitypack.
<div class="property-details-section"> <h5><span id="content_lblfurtherdetails">further details</span></h5> <ul id="features"> <li style="display:block;"> <table border="0" cellpadding="0" cellspacing="0" width="500"> <tr> <td style="width: 15px;"> <img src="../images/bullet.png" alt="bullet" /> </td> <td style="width: 185px;">views</td> <td style="width: 300px;">very country views</td> </tr> </table> </li> </ul> <li style="display:block;"> <table border="0" cellpadding="0" cellspacing="0" width="500"> <tr> <td style="width: 15px;"> <img src="../images/bullet.png" alt="bullet" /> </td> <td style="width: 185px;">finish</td> <td style="width: 300px;">good</td> <tr> </table> </li> </div>
i have tried following "very country views" no success:
htmlnode text = doc.documentnode.selectsinglenode("//ul[@id='features']/li/table/tr/td[3]");
i trying text "very country views" , "good"
you have select 2 elements, should use selectnodes instead of selectsinglenode, if want result @ once.
var result = doc.documentnode.selectnodes("//ul[@id='features']/li/*//td[last()]") .select(td => td.innertext) .tolist();
Comments
Post a Comment