views:

26

answers:

1

What i have this the follow code

foreach (HtmlNode link in htmldocObject.DocumentNode.SelectNodes("//a[@href]")) 
        { 
            HtmlAttribute attrib = link.Attributes["href"]; hTags.Add(att.Value);
        }

This pulls the Href perfectly but I would also like to pull the description of the href

Example

<a href="/users/logout?returnurl=%2fquestions%2fask">log out</a>

so I already get /users/logout?returnurl=%2fquestions%2fask but i would also like to get log out

result:

/users/logout?returnurl=%2fquestions%2fask | log out

+1  A: 

you want soemthing like:

hTags.Add(att.Value + " | " + link.InnerText);
Andrew Bullock
it's InnerText..
Mike
@Mike gah! so close!
Andrew Bullock