user12398554
user12398554

Reputation:

How to get value from website using Jsoup?

I want to extract href title <a href="https://kwejk.pl">43797</a> so I could assign it to variable in my app. My code is not working unfortunatelly.

I want to assign "43797" to string Result.

Upvotes: 0

Views: 38

Answers (1)

Andry Shutka
Andry Shutka

Reputation: 413

You've selected li tag Now you need to get first his child and then get text


    Elements liChildren = element.children();
    Element first = liChildren.first​();
    String res = first.text();

Upvotes: 1

Related Questions