2016-09-24 69 views

回答

1

「是否有可能獲得所有與類名row_?啓動要素(行)」

當然,這是可能的。

HtmlDocument doc; 
.... 
.... 

var resultXPath = doc.DocumentNode 
        .SelectNodes("//tr[starts-with(@class, 'row_')]"); 
var resultLINQ = doc.DocumentNode 
        .Descendants("tr") 
        .Where(o => o.GetAttributeValue("class","").StartsWith("row_")); 
:您可以使用HAP時 要麼使用 XPath或LINQ來表達您的查詢