开发者

Xpath expression matching several attributes for HtmlAgilityPack

开发者 https://www.devze.com 2022-12-14 20:07 出处:网络
Assuming I want to find a table with certain width and height attributes No problem with doc.DocumentNode.SelectSingleNode(\"//table[@width=\'500\']\");

Assuming I want to find a table with certain width and height attributes No problem with

doc.DocumentNode.SelectSingleNode("//table[@width='500']"); 

Would it be possible to add height='500' someho开发者_Python百科w to this Xpath expression ?


with logical "and" operator:

doc.DocumentNode.SelectSingleNode("//table[@width='500' and @height='500']");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号