문제

I got

var x =  document.DocumentNode.SelectNodes("*//tr[@class='even']")
var y = document.DocumentNode.SelectNodes("*//tr[@class='odd']")  

How can I combine these html node collections?

Edit:

gonna try x.Concat(y).ToList()

도움이 되었습니까?

해결책

Another option is using XPath approach. You can use XPath union (|) to combine two queries :

var xy = document.DocumentNode
                 .SelectNodes("*//tr[@class='even'] | *//tr[@class='odd']");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top