Tano
Tano

Reputation: 1377

Selecting multiple elements in jsoup

Is it possible in Jsoup to select multiple elements just with one query, to be more clear here is the image of the websites' structure: enter image description here so I want only the content inside these two elements, is it possible to do it with one query :/

Upvotes: 1

Views: 2352

Answers (1)

TDG
TDG

Reputation: 6151

You can use this -

Elements els = doc.select(".ingress,.body-text");

Now els.text() contains the whole content of those two elements.

Upvotes: 2

Related Questions