Question: I have a method that returns a string in the following format:

```
string tableTag = "<th><a href="Boot_53.html">135 Boot</a></th>"

```

I want to get the value of the `href` attribute and store it into another string called `link`:

```
string link = "Boot_53.html"

```

In other words, `link` should be assigned the `href` attribute in the string. How can I accomplish that?

Answer: 
Use [`HtmlAgilityPack`](http://htmlagilitypack.codeplex.com/) to parse HTML:

```
var doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml( tableTag ); 
string link = doc.DocumentNode.SelectSingleNode("//a").Attributes["href"].Value;

```
You can use [AngleSharp](https://anglesharp.github.io/) as an alternative to HtmlAgilityPack:

```
var context = BrowsingContext.New(Configuration.Default);

string tableTag = "<th><a href=\"Boot_53.html\">135 Boot</a></th>";

var document = await context.OpenAsync(req => req.Content(tableTag));

var anchor = document.All.FirstOrDefault(x => x.LocalName == "a");
if (anchor != null)
{
    string link = anchor.GetAttribute("href"); // "Boot_53.html"
}

```