You obviously have more than one element with the specified class, the getElementsByClass returns a collection containing all those Elements. So you probably want to extract the text of each one, for that you need to iterate over this collection the get each element and then get the text from it.
Here is an example
public class JsoupTest {
@Test
public void getTextByClass() {
String html = "<html>\r\n" +
" <body>\r\n" +
" <div class=\"jTit\">jtit 1</div>\r\n" +
" <div class=\"coName\">coname 1</div>\r\n" +
" <div class=\"foo\">foo</div>\r\n" +
" <div class=\"coName\">coname 2</div>\r\n" +
" <div class=\"jTit\">jtit 2</div>\r\n" +
" <div class=\"bar\">bar</div>\r\n" +
" </body>\r\n" +
"</html>";
Document doc = Jsoup.parse(html);
Elements jTitElements = doc.getElementsByClass("jTit");
for(Element e : jTitElements) {
System.out.println(e.text());
}
Elements coNameElements = doc.getElementsByClass("coName");
for(Element e : coNameElements) {
System.out.println(e.text());
}
}
}
This prints:
jtit 1
jtit 2
coname 1
coname 2