HtmlAgilityPack - How to get the tag by Id? <p>I have a task to do. I need to retrieve the a <code>tag</code> or <code>href</code> of a specific <code>id</code> (the <code>id</code> is based from the user input). Example I have a <code>html</code> like this </p> <pre><code>&lt;manifest&gt; &lt;item href="Text/Cover.xhtml" id="Cov" media-type="application/xhtml+xml" /&gt; &lt;item href="Text/Back.xhtml" id="Back" media-type="application/xhtml+xml" /&gt; &lt;/manifest&gt; </code></pre> <p>I already have this code. Please, help me. Thank you</p> <pre><code>HtmlAgilityPack.HtmlDocument document2 = new HtmlAgilityPack.HtmlDocument(); document2.Load(@"C:\try.html"); HtmlNode[] nodes = document2.DocumentNode.SelectNodes("//manifest").ToArray(); foreach (HtmlNode item in nodes) { Console.WriteLine(item.InnerHtml); } </code></pre>