Alright with the way below it is extracting only referring url like this
the extraction code :
foreach (HtmlNode link in hdDoc.DocumentNode.SelectNodes("//a[@href]"))
{
lsLinks.Add(link.Attributes["href"].Value.ToString());
}
The url code
<a href="Login.aspx">Login</a>
The extracted url
Login.aspx
But i want to get real link what browser parsed like
http://www.monstermmorpg.com/Login.aspx
I can do it with checking the url whether containing http and if not add the domain value but it may cause some problems at some occasions and i think not a very wise solution.
c# 4.0 , HtmlAgilityPack.1.4.0
Assuming you have the original url, you can combine the parsed url something like this:
Note the use of
AbsoluteUriand not relying onToString()becauseToStringdecodes the URL (to make it more “human-readable”), which is not typically what you want.