hello guys i am try to print the output of two element data simultaneously
Document document2 = Jsoup.parse(webPage2);
Document document22 = Jsoup.parse(webPage2);
Elements links2 = document2.select("a.yschttl");
Elements links22 = document22.select("div.abstr");
can we include both a.yschttl and div.abstr or…
for (Element link2 : links2) {
out.println(link2);
}
can we include two say links2 and links22 in same for loop…
or how to achive it…
If you are just trying to select both at the same time, you can do something like this:
If you are trying to make two selections and outputting those values in tandem, you will have to do something like @vacuum suggests, but being careful of the lengths of the lists.
A side note, you don’t have to parse the document twice to make two selections. You can parse once and select twice.