This is about the ChromeDriver for Selenium. So I know I can set the default directory by passing arguments to the Driver constructor like so:
chromeOptions = webdriver.ChromeOptions()
prefs = {"download.default_directory" : "/path/to/directory/"}
chromeOptions.add_experimental_option("prefs",prefs)
driver=Chrome(chrome_options=chromeOptions)
But I want to change that directory after a criteria has been met. Say after 15 files have been downloaded, I need to change my download location to "/path/to/new_directory/". Haven't really been able to find a simple solution to this.
Alternatively, I am also happy if I can simply rename files after my criteria has been met (the criteria is not as simple as every 15th file but you get the idea) but somehow that sounds like it would be trickier because Selenium has no access to the downloads once they start.