My scenario is: I had to write a script to download a huge amount of files by using Selenium and Python 3.6, and now, I have to download files using the same technologies.
The point is that this script won't be executed on my own computer.
Is it possible, using chrome webdriver, to get the default download folder of chrome?
As of now I have this code:
for file in os.listdir(dlPth):
if file.startswith("export") and file.endswith(".csv"):
newfile=os.path.join(nwPth,str(years[i]) +"-" +(str(months[j]) if months[j]>=10 else "0"+str(months[j]))+"-" +(str(days[k]) if days[k]>=10 else "0"+str(days[k])) +".csv")
dlPth=# Chrome's default download directory
The answers did not really help me, but thanks anyway. I find another way to do so by using the OS library:
# dlPth will be the path to the download directory of the current user (on the system) dlPth=os.path.join(os.getenv('USERPROFILE'), 'Downloads') # destPth will just be a directory where I'll put all my (renamed) files in. destPth=dlPth+"\\Exports\\"
Thanks for answering, I posted the answer here so anyone looking for some help on this topic will be able to see it