I'm parsing an HTML file using HTML Agility Pack. I want to get
<title>Some title <title>
As you see, title doesn't have a class. So I couldn't catch it no matter what I have tried. I couldn't find the solution on the web either. How can I catch this HTML tag which doesn't have a class? Thanks.
This might do the trick for you
HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(htmlContent); var result = doc.DocumentNode.SelectNodes("title").FirstOrDefault();