parsing html with HTMLAGILITYPACK and loading into datatable C#

放肆的年华 提交于 2019-12-04 20:09:09

Think of it slightly differently -- instead of wanting every anchor (with a href), You want every row from the body of the table with class style_15 (that id looks very generated on the fly); then, for every row, you'll want every cell.

foreach (var row in htmlSnippet.DocumentNode.SelectNodes("//table[@class = 'style_15']/tbody/tr"))
{
    foreach (var cell in row.SelectNodes("td"))
    {
        // Do something
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!