0
我使用的HTML敏捷包和我的节点后阵:C#HtmlAgilityPack对节点阵列
HtmlNode[] nodes = document.DocumentNode.SelectNodes("//tbody[@class='table']").ToArray();
现在我想运行一个for循环每一个节点[1]。我试过这个:
for (int i = 0; i < 1; i++)
{
if (t == null)
t = new Model.Track();
HtmlNode[] itemText = nodes[i].SelectNodes("//td[@class='artist']").ToArray();
for (int x = 0; x < itemText.Length; x++)
{ //doing something }
问题是itemtext数组没有关注节点[i]。 ,但在html文档中显示了所有(“// td [@ class ='artist']”)的数组。 有帮助吗?
你能分享你要通过这个或HTML获取的链接吗? –
我已经得到了正确的答案zroq,无论如何。 – hhh