我有一个包含这样的段落标签的 div
<div class="div_5">
<p>First Paragraph</p>
<p>Second Paragraph</p>
<p>Third Paragraph</p>
<p>Fourth Paragraph</p>
</div>
<div class="div_5">
<p>First Paragraph</p>
<p>Second Paragraph</p>
<p>Third Paragraph</p>
<p>Fourth Paragraph</p>
</div>
我需要使用htmlagiitypack获取所有段落文本的文本我试过这个,
Dim oPB As HAP.HtmlNodeCollection = doc.DocumentNode.SelectNodes("//div[@class='post-bodycopy clearfix']/child::text()/"]
For Each item As HAP.HtmlNode In oPB
debug.print(item.InnerText)
Next
我期望每个 div 字符串的输出是
First Paragraph
Second Paragraph
Third Paragraph
Fourth Paragraph
但是我在返回的文本中得到了一些 html,有人可以帮我纠正这个问题吗