【发布时间】:2016-01-03 01:12:06
【问题描述】:
<div id='contents'>
<div class="article_view">
<div class="article_txt">
<strong>I don't want to get this point
<br>I don't want to get this point
<br>I don't want to get this point
</strong>
<div class='articlePhotoC'>
<img src="" width='500'>
<span class='t' style='width:480px;'>
<b>I don't want to get this point </b>
I don't want to get this point<br>
</span>
<div id='adBox' class='txt_ad' style='width:500px;'></div>
</div>
From here I want to get--------------
<br><br>
<div class='sub_cont_AD08'></div>
</div>
</div>
我不知道如何在 Java 中使用 notSelector。
我试着这样做:
Elements cont = doc.select("div.article_view :not(div.article_view)");
但它不起作用。结果包括所有“我不想明白这一点”。我希望只得到“从这里我想得到~~~~”。
谢谢!
【问题讨论】:
-
您是否还需要文本节点“从这里我想得到--------------”,或者这只是一个评论?
标签: java html html-parsing jsoup