Q: Select value of tag in HTML with Microsoft Agility Pack I have html code with this element.
<span itemprop="datePublished" content="2016-06-18T00:44:00+06:00">০০:৪৫, জুন ১৮, ২০১৬</span>

With Agility Pack I want value "2016-06-18T00:44:00+06:00" of Attribute content. I can select InnerText with this code:
HtmlDocument.DocumentNode.SelectSingleNode("//span[@itemprop='datePublished']");


A: Use GetAttributeValue(attrName, defaultVal) method which return attribute value of name attrName if it exists, and return defaultVal otherwise :
var span = HtmlDocument.DocumentNode.SelectSingleNode("//span[@itemprop='datePublished']");
var content = span.GetAttributeValue("content", "");

