Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Python) Firefox Options don't allow relative paths for browser.download.dir #123

Open
KatMerrill opened this issue Jul 27, 2024 · 0 comments

Comments

@KatMerrill
Copy link

KatMerrill commented Jul 27, 2024

Hi! I am using Helium with Firefox, and I was trying to set the FirefoxOptions so that all downloads automatically go to a specified folder. I was able to do this using the full path of the desired folder, but using a relative path such as "./downloads", ".\downloads", or ".downloads" does not seem to work. Is it possible for someone to add this functionality? (Or does it already exist and I'm doing something wrong?)

Here is the code I am using:

options = FirefoxOptions()
options.set_preference("browser.download.useDownloadDir", True)
options.set_preference("browser.download.folderList", 2)
options.set_preference("browser.download.dir", download_directory)
driver = start_firefox(options=options)

where download_directory is set to either a full path (ie. "C:\..."), which does work, or to a relative path (ie. "./downloads"), which did not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant