我使用selenium和python v3.6自動化firefox將文件下載到自定義文件夾中。該文件夾的位置是C:/Users/username/Dropbox/Inv/
。這個硒火狐配置文件下載文件到自定義文件夾有什麼問題?
下面是我的firefox個人資料。
profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2) # custom location
profile.set_preference('browser.download.manager.showWhenStarting', False)
profile.set_preference('browser.download.dir', 'C:/Users/username/Dropbox/Inv/')
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/plain')
profile.set_preference('browser.helperApps.neverAsk.openFile', 'text/plain')
目前,該文件總是下載到默認文件夾C:\Users\username\Downloads
。如何獲取下載的文件夾位置爲C:/Users/username/Dropbox/Inv/
?
可能的重複[下載並保存多個csv文件使用硒和彈出窗口中的python](https://stackoverflow.com/questions/45097302/download-and-save-multiple-csv-files-using-selenium-and -python-from-popup) – DebanjanB