我有这个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")
有没有人有任何想法?
谢谢。