There is such a piece of webcode. You need to choose 4591077 .

 <div class="story" data-story-id="4591077" data-visited="false" data-story-long="false"> 

In this place you need to choose 2 ноября 2016 в 23:58 .

 <div class="story__date" title="2 ноября 2016 в 23:58">7 дней назад</div> 

I can not figure it out. Thank you in advance!

    1 answer 1

    Use the attr(...) method, which returns its value by attribute name:

    First:

     Document page = Jsoup.parse("<div class=\"story\" data-story-id=\"4591077\" data-visited=\"false\" data-story-long=\"false\">"); int dataStoryId = Integer.parseInt(page.select("div.story").attr("data-story-id")); 

    Second:

     Document page = Jsoup.parse("<div class=\"story__date\" title=\"2 ноября 2016 в 23:58\">7 дней назад</div>"); String title = page.select("div.story__date").attr("title"); 
    • Thank you, I suffered for two days with this - Roman DriveMind
    • Understood thanks - Roman DriveMind