I have the following code
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", os.path.dirname(os.path.realpath(__file__)))
profile.set_preference("browser.helperApps.neverAsk.openFile", "application/zip")
driver = webdriver.Firefox(firefox_profile=profile)
But when the zip file gets downloaded it still gets downloaded to my temp dir.
Any help here will be greatly appreciated!
You need to make two minor modifications as follows:
with:
followed by the line:
Effectively, your code block will be:
References
You can find a detailed discussion on
os.path.abspath(os.path.dirname(__file__))in what does the file variable mean/do?