I am trying to read all \"listitem show-in-category\"
from an HTML page. Furthermore, I want to get the itemprop
The spaces in the class name are actually separator between class names. So the div is part of two classes, namely listitem
and show-in-category
If you must select only elements that match both classes, you can do this:
Elements mydesiredElems = doc.select("div.listitem.show-in-category")
The dot followed by a class name is the css selector for a class. They can be concatenated and that results in adding this class as a requirement to match the element.
About your second question: Jsoup can easily get the img element for you. Suppose that myDivEl is one of your divs
Element imgEl = myDivEl.select("img");
String altStr = imgEl.attr("alt");
String titleStr = imgEl.attr("title");
UPDATE after question was edited to point out what the OP wants:
Element itemPropPEl = myDivEl.select("p[itemprop=description]");
String descStr = itemPropPEl.text();