我想下载多个文件并保存到不同的位置
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.folderList", 2);
profile.setPreference("browser.download.dir", "D:\\");
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/msword");
System.setProperty("webdriver.chrome.driver","C:/Program Files/Mozilla Firefox/firefox.exe");
f =new FirefoxDriver(profile);
for(int i = 0; i<10; i++){
//I want to change download dir name here with count**
}
答案 0 :(得分:0)
只有几种方法可以做到这一点。驱动程序启动后无法更改下载目录,因此始终可以选择下载一个文件,重新启动驱动程序,然后以相同方式下载其他文件。