开发者

Extract date from a website page

I need to extract date from a page, for example:

<div class="update" style="width: 1037px;">
    Last update:
    <span id="last_update">6.30.2011</span>
</div>

I want to retrieve th开发者_运维百科e date (6.30.2011, in the above example). I have jsoup: Java HTML Parser.


Using jSoup it’s as easy as

Element result = doc.select("#last_update").first();
String date = result.text();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜