1
我需要从两个表获取信息:迭代每个表,并获得信息
我遍历每个表,并从每个表我从TD的信息
但我得到的信息两次和orderingText填充x2,所以为了防止第二次迭代我把中断阻止它,但我觉得不是具体如何工作HtmlAgilityPack还是我做错事的方式
// Get the node from the div
//
HtmlNode orderingProcNode = docProcSpecs.DocumentNode.SelectSingleNode("//div[@id='orderingordering']");
string[] orderingText = new string[1024];
int t = 0;
// Iterate each table
foreach (HtmlNode orderingProcessor in orderingProcNode.SelectNodes("//table[@class='noSort infoTable']"))
{
foreach (HtmlNode ordProcessor in orderingProcessor.SelectNodes("//tbody//tr//td"))
{
// Here I get all the info from the two tables instead of one table
//
orderingText[t++] = ordProcessor.InnerText.Trim();
}
break; // this is the solution
}
pfff你的权利...谢谢! – tttony 2012-02-27 00:26:59