HtmlDocument hdoc = new HtmlDocument();
HtmlNode abcTable;
HtmlNodeCollection tableCells;
hdoc.Load("test1.html");
abcTable = hdoc.DocumentNode.SelectSingleNode("//table[@summary='ABC']");
tableCells = abcTable.SelectNodes("//td");
foreach (HtmlNode cell in tableCells)
{
Response.Write(cell.InnerText);
}
The result using the above code:
Field1 Value1 Field6 Value6 Field2 Value2 Field7 Value7 Field3 Value3 Field8 Value8 Field4 Value4 Field9 Value9 Field5 Value5 Field10 Value10
Field11 Field12 Field13 Field14 Field15 Field16 Field17 Field18 Field19
Valu11 Valu12 Valu13 Valu16 Valu17
Field1 Value1 Field6 Value6 Field2 Value2 Field7 Value7 Field3 Value3 Field8 Value8 Field4 Value4 Field9 Value9 Field5 Value5 Field10 Value10
Field1 Value1 Field6 Value6 Field2 Value2 Field7 Value7 Field3 Value3 Field8 Value8 Field4 Value4 Field9 Value9 Field5 Value5 Field10 Value10
Field11 Field12 Field13 Field14 Field15 Field16 Field17 Field18 Field19
Valu11 Valu12 Valu13 Valu16 Valu17
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE