首页 > 代码库 > HtmlAgilityPack 使用

HtmlAgilityPack 使用

或、无属性、属性个数、属性值:

var preceding_siblings = node.SelectNodes("preceding-sibling::input| preceding-sibling::button[count(@role)>0] | preceding-sibling::div[not(@*)]"); 

var ancestors = node.SelectNodes("ancestor::div | ancestor:div[@level=‘primary‘] | ancestor::div/ul");

以全小写查找:

var content_venue_nodes = this.GetNodes("//div//text()[contains(translate(.,‘ABCDEFGHIJKLMNOPQRSTUVWXYZ‘,‘abcdefghijklmnopqrstuvwxyz‘),‘hello world‘)]");

 

......

HtmlAgilityPack 使用