c# - Html Agility Pack - XPath can't use contains -


i got following problem: i'm using xpath feature of html agility pack navigate through html.

i tried following xpath in browser (firebug - xpath extension) , worked fine:

//tr[contains(@data-link-to, '/test/')] 

sadly html agility pack doesn't seem find it. if try direct path (html/body/etc) works.

is there work-around can use? want find table rows have attribute "data-link-to" containts "/test/".

am doing wrong? html agility pack use older version of xpath?

example of html:

<!doctype html> <html>     <head>         <meta http-equiv="content-type" content="text/html; charset=utf-8">         <meta content="en" name="locale">         <meta content="width=device-width, initial-scale=1" name="viewport">     </head>     <body>     <section>         <header>         <article>             <table>             <thead></thead>                 <tbody>                     <tr data-link-to="/test/1">                     <tr data-link-to="/test/2">                     <tr data-link-to="/test/3">                 </tbody>             </table>     </article>     </section>     </body> </html> 

this works

 //section/article/table/tbody/tr 

this doesn't work

//tr[contains(@data-link-to, '/test/')] 

obviously working solution error prone.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -