Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: How can select a div with classname contain "post"

$
0
0

I'd recommend using the LINQ compatible functions

var results = doc.DocumentNode
                 .Descendants("div")
                 .Where(x=>x.Attributes.Contains("class") &&
                           x.Attributes["class"].Value.Contains("post"));
This will get a list of all divs that contain a the word post in the class attribute

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>