Alex
Alex

Reputation: 2181

Having problems parsing HTML + Jsoup

I am trying to parse my html file with jsoup and I need to build Elements object which will contain an array of divs (like on picture below). How can i do that with select syntax?

enter image description here

Each element of Elements must contains "news":

enter image description here

Thanks!

Upvotes: 1

Views: 490

Answers (1)

BackSlash
BackSlash

Reputation: 22233

You select class names with the dot (.) selector, and ids with #, so:

Elements newsClass = myDocument.select(".news");
Elements newsMainId = myDocument.select("#newsMain");

Upvotes: 1

Related Questions