【发布时间】:2013-01-14 17:26:12
【问题描述】:
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border" id="center_table">
<tbody>
<tr>
<td width="25%" class="heading_table_top">S. No.</td>
<td width="45%" class="heading_table_top">
Booking Status (Coach No , Berth No., Quota)
</td>
<td width="30%" class="heading_table_top">
* Current Status (Coach No , Berth No.)
</td>
</tr>
</tbody>
</table>
我废弃了一个网页并将响应存储在一个字符串中。
然后我把它解析成 jsoup doc
Document doc = Jsoup.parse(result);
然后我选择表格使用
Element table=doc.select("table[id=center_table]").first();
现在我需要使用 jsoup 将标签“预订状态(教练号,泊位号,配额)”中的文本替换为“预订状态”。有人可以帮忙吗?
我试过了
table.children().text().replaceAll(RegEx to select the text?????, "Booking Status");
【问题讨论】:
-
编辑了我的问题。请检查
-
而且您还清楚地确定了您想要实现的目标? “替换文字”似乎很模糊
标签: java android html parsing jsoup