C# Using HtmlAgilityPack

07/18/2012 16:24 badguy4you#1
Hi guys i am facing an annoing problem please i wanna to have your help with it

i have the following html

Code:
<div class="sideInfo">
<a class="getLink" href="info">
<span class="wrap">NEW</span>
</a>
<img class="nation" src="img/xyz.png" alt="NEW">
</div>
i am trying

Code:
var Value = GET.DocumentNode.SelectSingleNode("//a[@class='getLink']").Attributes["href"].Value;
to get the href value but i always get an error and cant get it so please help me to know what is going on

ERROR LOG :
Object reference not set to an instance of an object.
07/18/2012 16:48 boxxiebabee#2
Code:
string html =
                "<div class='sideInfo'><a class='getLink' href='info'><span class='wrap'>NEW</span></a><img class='nation' src='img/xyz.png' alt='NEW'></div>";
            var doc = new HtmlDocument { OptionFixNestedTags = true };
            doc.LoadHtml(html);
            HtmlNode node = doc.DocumentNode.SelectSingleNode("//a[@class='getLink']");
            string href = node != null ? node.Attributes["href"].Value : null;