It didnt work to accept alert
But I found the box:
Almost there! Now Firefox shows the dialog to start downloading, and it has to be dismissed manually. I added the following code to prevent the dialog from coming up, but probably I give it the wrong content type. How do I find out what content type the downloaded file is?
Quote:NoAlertPresentException: No modal dialog is currently open
But I found the box:
<div id="cadboxClose" class="">close</div>And now it closes:
driver.find_element_by_id("cadboxClose").click()
Almost there! Now Firefox shows the dialog to start downloading, and it has to be dismissed manually. I added the following code to prevent the dialog from coming up, but probably I give it the wrong content type. How do I find out what content type the downloaded file is?
profile = webdriver.FirefoxProfile() profile.set_preference("browser.helperApps.neverAsk.openFile", "text/csv") profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv") profile.set_preference("browser.helperApps.alwaysAsk.force", False); profile.set_preference("browser.download.manager.showWhenStarting",False) profile.set_preference("browser.download.manager.useWindow", False); profile.set_preference("browser.download.manager.focusWhenStarting", False); profile.set_preference("browser.download.manager.alertOnEXEOpen", False); profile.set_preference("browser.download.manager.showAlertOnComplete", False); profile.set_preference("browser.download.manager.closeWhenDone", True); profile.set_preference("pdfjs.disabled", True); profile.set_preference("browser.download.dir", '/home/justme/downloads/') profile.set_preference("browser.download.folderList", 2)