标签:
//选择不包含class属性的节点 var result = node.SelectNodes(".//span[not(@class)]"); //选择不包含class和id属性的节点 var result = node.SelectNodes(".//span[not(@class) and not(@id)]"); //选择不包含class="expire"的span var result = node.SelectNodes(".//span[not(contains(@class,‘expire‘))]"); //选择包含class="expire"的span var result = node.SelectNodes(".//span[contains(@class,‘expire‘)]");
HtmlAgilityPack 处理通配符
doc.DocumentNode.SelectNodes("//input[contains(@id, ‘bt‘)]")
doc.DocumentNode.SelectNodes("//input[contains(@name, ‘__‘)]")
doc.DocumentNode.SelectNodes("//input[starts-with(@id, ‘tb‘)]")
标签:
原文地址:http://www.cnblogs.com/yunspider/p/4959425.html