I want to download a MP3 file, when I'm clicking on ID "imgAudioCaptcha" sound button. (python 2.7) - (My firefox ver: 43)
I want to save download, but the doesn't happen and without downloading the file, program is closed.
please help me. thanks a lot
Note: if you have IDM(Internet Download Manager) you can see the pop-uped file after clicking on sound button.
THe site: http://it.kntu.ac.ir/Dorsapax/signin.aspx
source:
from selenium import webdriver
import selenium, time, os
profile = webdriver.FirefoxProfile()
profile.set_preference('startup.homepage_welcome_url.additional', "http://it.kntu.ac.ir/Dorsapax/signin.aspx")
profile.set_preference('browser.download.hide_plugins_without_extensions', False)
profile.set_preference('extensions.mozilla_cc@internetdownloadmanager.com.install-event-fired', False)
profile.set_preference('browser.startup.page', "1")
profile.set_preference("browser.download.folderList", "2")
profile.set_preference("browser.download.dir", os.getcwd())
profile.set_preference("browser.helperApps.neverAsk.openFile", "audio/mpeg")
profile.set_preference("browser.helperApps.neverAsk.saveTsoDisk", "audio/mpeg")
driver = webdriver.Firefox(profile)
driver.implicitly_wait(30)
driver.set_window_size(850, 650)
cap_audio = driver.find_element_by_id("imgAudioCaptcha").click()
driver.close()