开发者

Extract date from a website page

开发者 https://www.devze.com 2023-03-17 10:52 出处:网络
I need to extract date from a page, for example: <div class=\"update\" style=\"width: 1037px;\">

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

精彩评论

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