Html Agility Pack - loop through rows and columns

前端 未结 2 967
别那么骄傲
别那么骄傲 2021-01-16 02:13

How can I loop through table and row that have an attribute id or name to get inner text in deep down in each td cell? I work on asp.net, c#, and the newest html agility pac

2条回答
  •  情深已故
    2021-01-16 02:51

    You need to select these nodes using xpath:

    foreach(HtmlNode cell in doc.DocumentElement.SelectNodes("//tr[@name='display']/td")
    {
       // get cell data
    }
    

提交回复
热议问题