我想提取div类之间的文本“Some text goes here”。 我使用的HTML敏捷包,和C#如何使用htmlagilitypack提取div标签内的文本
<div class="productDescriptionWrapper">
Some Text Goes here...
<div class="emptyClear"> </div>
</div>
这是我有:
Description = doc.DocumentNode.SelectNodes("//div[@class=\"productDescriptionWrapper\").Descendants("div").Select(x => x.InnerText).ToList();
我得到这个错误:
An unhandled exception of type 'System.NullReferenceException'
我知道如果文本如何提取是b/wa <h1>
或<p>
,而不是后代中的“div”,我将不得不给出“h1”或“p”。
有人请协助。
'[@class = \“productDescriptionWrapper \”''的右括号在哪里? – BCdotWEB
可能是我错过了,当我在这里输入它时,它不工作.. – fizmhd