I am downloading several different data sets and would like each file (or set) to download to a specific folder. I have learned how to change the download directories at these page:
setting Chrome preferences w/ Selenium Webdriver in Python
Change the default chrome download folder webdriver C#
The problem is these methods only allow me to change the download directory when I open the webdriver. It takes a while to get to the download page so doing this is an ineffective solution. I've tried set preferences but I'm working with selenium webdriver and chrome in python and I have not been able to find anything on SO or in the python help. Even switching the window handle on a new driver won't work because it cannot grab another driver's already open window.
The link for the download site is customized so can't copy and paste into a new driver either. So far I've been using the os. module to get the name of each new file coming in but even this is unreliable because of varying download times.
If anyone has any idea on how to change the default settings to a webdriver while the webdriver is running that would be great. Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…