<div id="fareSelectModifySearch">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style="padding-left:8px;"><strong>1 Traveler(s)</strong> <span id="routeInfo"> New York, NY (JFK) to Las Vegas, NV (LAS) on 09/20/2013</span></td>
</tr>
</tbody>
</table>
</div>
我想提取td
元素数据,即
1旅行者纽约,纽约(JFK)于2013年9月20日到内华达州拉斯维加斯(LAS)
任何人都可以使用Jsoup
库给我这个源代码。
试试这个
Document site2 = Jsoup.connect("http://wl.filegenie.com/~ikp4success/test.html")
.timeout(3000000)
.get();
String values = site2.select("td").text();
System.out.println(values);
我将文件上传到我的服务器FYI。
你尝试过.text()方法吗?
来自jSoup文档。
String text()
Get the combined text of all the matched elements.