Suppose I have a table that contains a list of tr and th, I need to know if the current tag in iteration is a th or a tr, what I did for the moment:
foreach (var tr in rows)
{
if(tr.InnerHtml.StartsWith("<th"))
I'm looking for a more elegant way..
You can use the Name
property:
foreach (HtmlNode node in rows)
{
if(node.Name == "tr")
{
// ....
}
}