문제

I have only seen examples on how to search for nodes where attributes have or contain certain values but I cannot find one where you search for nodes where the attribute exists to start with.

How is that done?

도움이 되었습니까?

해결책

You could try to just loop over it :

HtmlAgilityPack.HtmlDocument doc = htmlWeb.Load("somewebsite.org");    
foreach(HtmlNode matchedNode in doc.DocumentNode.SelectNodes("//*[@attrX]") {
    /* ... */
} 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top