0
votes

I am automatically downloading some links through a website and it is getting saved by default in Download directory but I want to save those links to the desired location as per the need. I am using Python 3.

I am using this code but it is not working.

options = webdriver.ChromeOptions()
options.add_argument("download.default_directory=C://Users//ASUS//Downloads")
driver = webdriver.Chrome(r"C:\Users\ASUS\Downloads\chromedriver.exe",chrome_options=options)
driver.implicitly_wait(30)

Any type of help will be appreciated.

Thank you..

1
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. - halfer
okey sir i'll remember from now onwards. @halfer - Ishita Agrawal

1 Answers

0
votes

As per your code trial you have set the download.default_directory through an instance of ChromeOptions while initializing the WebDriver and WebBrowser instance which remains unchanged throughout the lifespan of the WebDriver and WebBrowser instance.

While the WebDriver and WebBrowser instance is active even if you are able to extract any of the capabilities or other session attributes from the current Browsing Session still you won't be able to change any of those attributes of the currently active WebDriver instance e.g download.default_directory. If you want to change any of the capabilities or other session attributes you have re-configure the WebDriver instance again.