C# 解析html 的工具库

使用这个工具 HtmlAgilityPack

 

var doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(html);
var nodes = doc.DocumentNode.SelectNodes("//table[@id='game_table']/tbody/tr").Skip(1);
while (nodes.Count() > 0)
{
var node = nodes.First();
var style = node.Attributes["style"].Value;
    if (style == "display:;")
    {
  nodes = nodes.Skip(1);
  continue;
    }

}

posted @ 2021-07-07 11:37  吖水的程序路  阅读(257)  评论(0编辑  收藏  举报