how can i navigate to the next page in a for loop without failing the loop?i m trying to download all the pdfs : This is my code , I'm trying to download all the Pdf's from the webpage <https://iaeme.com/ijmet/index.asp> . The page has different links , inside each link there are multiple downloads and more pages , i m trying to navigate the next page and continue the loop . pls help !      
 package flow;
            
            import java.io.File;
            import java.io.FileInputStream;
            import java.io.FileNotFoundException;
            import java.io.FileOutputStream;
            import java.io.IOException;
            import java.net.URL;
            import java.nio.file.Files;
            import java.nio.file.Path;
            import java.nio.file.StandardCopyOption;
            import java.util.List;
            import java.util.NoSuchElementException;
            
            import org.apache.poi.ss.usermodel.Cell;
            import org.apache.poi.ss.usermodel.Row;
            import org.apache.poi.xssf.usermodel.XSSFSheet;
            import org.apache.poi.xssf.usermodel.XSSFWorkbook;
            import org.apache.tools.ant.taskdefs.Java;
            import org.apache.tools.ant.types.FileList.FileName;
            import org.openqa.selenium.By;
            import org.openqa.selenium.JavascriptExecutor;
            import org.openqa.selenium.WebDriver;
            import org.openqa.selenium.WebDriver.Navigation;
            import org.openqa.selenium.WebElement;
            import org.openqa.selenium.chrome.ChromeDriver;
            import org.w3c.dom.Text;
            
      import jxl.common.Assert;
      //kindly ignore the imports 
            
            
     public class excel {
            
            	
     public static void main(String[] args) throws IOException, Exception {
            
     System.setProperty("webdriver.chrome.driver", 
    "C:\\Users\\User_2\\Downloads\\chromedriver_win32\\chromedriver.exe");
       WebDriver d=new ChromeDriver();
      d.manage().window().maximize();
      d.get("https://iaeme.com/ijmet/index.asp");
                	 
     java.util.List<WebElement> catvalues=d.findElements(By.className("issue"));
     for(int i=0;i<=catvalues.size();i++){  
     catvalues.get(i).click();
            	     
     java.util.List<WebElement> 
    downcount=d.findElements(By.linkText("Download"));
      System.out.println(downcount.size());
            		    	 
      for(int k=1;k<=downcount.size();k++){  
      downcount.get(k).click();
            	                             	 
      Thread.sleep(5000);   
            		    	 
      }
            		 
      d.navigate().back();
      catvalues = d.findElements(By.className("issue"));
    }
    }  
    }

I tried different moethods which failed , kindly help 
