c# - When to use double slash in HtmlAgilityPack SelectNodes -
i want loop through rows in table , select
in row.
foreach (var r in table.selectnodes("tr")) { var paragraphs = r.selectnodes("//p"); }
why have have use selectnodes("//p") , not selectnodes("p")? if later null.
i'm wondering why don't "//tr" in foreach statement.
as such written //p
, in case, find "p"
nodes located @ depth within html
tree of tr
element.
if write /p
search in root node of html
tree of tr
element
example:
with //p
find 2 <p>
elements, /p
not find , null return.
<tr> <div> <p></p> </div> <div> <div> <p></p> </div> <div> </tr>
in case, if search /p, element found.
<tr> <p></p> </tr>
Comments
Post a Comment