【发布时间】:2018-10-29 10:27:57
【问题描述】:
假设我已经关注 html 文档
<div class=" wrap_body text_align_left" style="">
<div class="some"> hello </div>
<div class="someother"> world </div>
hello world
</div>
我想提取这个
<div class="some"> hello </div>
<div class="someother"> world </div>
hello world
使用带有 c# 或 vb.net 的 HtmlAgilityPack 进行提取的最佳方法是什么? 这是我的代码,直到完成,但有些挣扎。 谢谢!
For Each no As HtmlAgilityPack.HtmlNode In docs.DocumentNode.SelectNodes("//div[contains(@class,'wrap_body')]")
Dim attr As String = no.GetAttributeValue("wrap_body", "")
Next
【问题讨论】:
标签: c# html vb.net html-agility-pack