【发布时间】:2011-12-08 02:58:54
【问题描述】:
我有这个 html。我正在尝试获取其中没有任何标签的 InnerText,
<h1>my h1 content</h1>
<div class="thisclass">
<p> some text</p>
<p> some text</p>
<div style="some_style">
some text
<script type="text/javascript">
<!-- some script -->
</script>
<script type='text/javascript' src='some_script.js'></script>
</div>
<p> some text<em>some text</em>some text.<em> <br /><br /></em><strong><em>some text</em></strong></p>
<p> </p>
</div>
我试图做的是获取用户从类thisclass中看到的文本。 我想去掉任何脚本标签和所有标签,只得到纯文本。
这是正在使用的:
Dim Tags As HtmlNodeCollection = root.SelectNodes("//div[@class='thisclass'] | //h1")
有人有什么想法吗?
谢谢。
【问题讨论】:
标签: vb.net dom html-parsing html-agility-pack strip-tags