使用 Jericho,我需要解析如下内容:
<html>
<div class="title">
Spoon bows
<br/>
<span>
A Matrix scene.
<br/>
Matrix 1
</span>
</div>
</html>
我想解析“Spoon bows”,但我<div>
使用以下代码获取标签中的全部内容:
List<Element> list = item.getAllElementsByClass("title");
if(list!=null) {
Element title = list.get(0);
if(title!=null) {
String text = title.getContent().getTextExtractor().toString();
}
}
}