-1
Reviewsq.size();
for (int i=0; i < 2; i++) {
    String rev = Reviewsq.get(i).text() + "\n";
    if (rev.isEmpty()) {
        break;
    }
}

I want to break and continue to other elements after the element is not found in Jsoup though am getting the above errors any idea how to rectify this ?

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360

1 Answers1

0

The obvious fix here would be to just use the size of the Reviewsq object in the bounds of the for loop:

for (int i=0; i < Reviewsq.size(); i++) {
    String rev = Reviewsq.get(i).text() + "\n";
    if (rev.isEmpty()) {
        break;
    }
}
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360