HtmlAgility返回相同的值 [英] HtmlAgility returning the same value

查看:56
本文介绍了HtmlAgility返回相同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

价格和可用性如何从第一个循环返回相同的值?



How come price and availability keeps returning the same value from the first loop?

HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.Load("test.htm");

foreach (HtmlNode row in html.DocumentNode.SelectNodes("//*[@id=\"product_list\"]/li/div[2]/h3/a"))
{
     HtmlNode price = row.SelectSingleNode("//*[@id=\"product_list\"]/li/div[3]/div/span[1]");
     HtmlNode available = row.SelectSingleNode("//*[@id=\"product_list\"]/li/div[3]/div/span[2]");





谢谢



Thanks

推荐答案

我已经回复了你这里 [ ^ ],在你的一个上以前的问题。



实际上我只是注意到你为同一主题发布了多个问题,将来请不要这样做,这在CodeProject和您的问题很容易因此而被关闭。
I've answered you here[^], on one of your previous questions.

Actually I just noticed that you posted multiple questions for the same subject, in the future please don't do that, that is not allowed in CodeProject and your questions can easily get closed due to it.


这篇关于HtmlAgility返回相同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆