HtmlAgilityPack using XPath contains a method
I am using HtmlAgilityPack and I need to know if the class attribute contains a specific word, now I have this page:
<div class="yom-mod yom-art-content "><div class="bd"> <p class="first"> .................... </p> </div> </div>
I'm doing it:
HtmlDocument doc2 = ...; List<string> paragraphs = doc2.DocumentNode.SelectNodes("//div[@class = 'yom-mod yom-art-content ']//p").Select(paragraphNode => paragraphNode.InnerHtml).ToList();
But this is too specific what I need, it is something like this:
List<string> paragraphs = doc2.DocumentNode.SelectNodes("//div[contains(@class, 'yom-art-content']//p").Select(paragraphNode => paragraphNode.InnerHtml).ToList();
But this does not work, please help me ..
source share