我想使用 Selenium WebDriver 递增/循环 URL
Ex: Volume 1 : www.abc.com/1/1 www.abc.com/1/2 www.abc.com/1/3 www.abc.com/1/4 Volume 2: www.abc.com/2/1 www.abc.com/2/2 www.abc.com/2/3 www.abc.com/2/4 www.abc.com/2/5
等等..
1. Once the Volume 1, Issues 4 Fished moves into Volume 2 and check all issues and moves into Next Volume 3..
最佳答案
简单的 For 循环对您的场景很有帮助。您可以使用 Java 来完成此操作,如下所示:
{
System.setProperty("webdriver.chrome.driver", "D:/Selenium/Drivers/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
int i,j;
for(i=1;i<5;i++)
{
for(j=1;j<10;j++)
{
String url = "https://website.com/"+i+"/"+j+"";
driver.get(url);
}
}
}
i 是您第一卷的计数,j 是您提到的问题的计数。 您可以根据您的要求进行定义。
希望对您有帮助。
关于java - 使用 selenium webdriver 递增/循环 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44630953/