I'm trying to click on a part of a webpage, but I'm getting the message "NoSuchElementException: Unable to locate element"....despite the element is there.
The code used to work, however it looks like there was a change in the page..but the xpath did not changed.
I tried different solutions of similar questions here in Stackoverflow, but something is not correct yet for this example.
The URL is: "http://www.bmfbovespa.com.br/pt_br/servicos/market-data/consultas/mercado-a-vista/codigo-isin/pesquisa/"
The element I`m trying to click : "Download de Arquivos"
My code:
from selenium import webdriver
fp = webdriver.FirefoxProfile()
fp.set_preference("browser.download.folderList",2)
fp.set_preference("browser.download.manager.showWhenStarting",False)
fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/msword, application/csv, application/vnd.ms-excel, application/ris, text/csv, image/png, application/pdf, text/html, text/plain, application/zip, application/x-zip, application/x-zip-compressed, application/download, application/octet-stream")
fp.set_preference('browser.helperApps.alwaysAsk.force', False)
driver = webdriver.Firefox(firefox_profile=fp)
driver.get("http://www.bmfbovespa.com.br/pt_br/servicos/market-data/consultas/mercado-a-vista/codigo-isin/pesquisa/")
###
# Click "Download de arquivos" (the part with problem)
###
elem=driver.find_element_by_xpath(".//*[@id='ctl00_contentPlaceHolderConteudo_rtsDetalhe_tabDownload']/span/span")
elem.click()
Any thoughts?