Getting attribute value from Div tag via jSoup

I have a div tag as below

<div id="eventTTL" style="text-transform: uppercase; font-weight: 900;" eventTTL="4583476000">5 days 07:14:41</div> 

How to get eventTTL value? I want to show the value of eventTTL, that is :) "4583476000".

+7
source share
1 answer
 Element div = doc.getElementById("eventTTL"); String attr = div.attr("eventTTL"); System.out.println(attr); 

Additional information: https://jsoup.org/cookbook/extracting-data/attributes-text-html

+14
source

All Articles