How do i get direct Descendants with html agility pack

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-05-18T16:24:43Z Indexed on 2010/05/18 16:31 UTC
Read the original article Hit count: 283

Filed under:
|

I have a specific html node and i want to get the 2nd aka last direct descendant. So after writing .Descendants("div") i wrote ls.Last(). I actually got the last div in the 2nd descendant. Not what i am expecting. How do i get only the direct descendants? or how do i get the descendant with a specific classname? because "div.postBody" would be a suitable alternative.

© Stack Overflow or respective owner

Related posts about htmlagilitypack

Related posts about .NET