Download and save multiple csv files using selenium and python from popup

后端 未结 2 1524
慢半拍i
慢半拍i 2020-11-30 14:33

I want to download csv files from \"https://clinicaltrials.gov/ct2/results?cond=&term=lomitapide&cntry1=&state1=&SearchAll=Search+all+studies&recrs=\" we

2条回答
  •  -上瘾入骨i
    2020-11-30 15:18

    You are getting the exception ElementNotInteractableException because the element will be accessible after once the popup opens up. You are missing to click the download link which opens up the popup. please try the following,

    from selenium import webdriver
    fp=webdriver.FirefoxProfile()
    fp.set_preference("browser.helperApps.neverAsk.saveToDisk","text/csv")
    browser = webdriver.Firefox(fp)
    browser.get("https://clinicaltrials.gov/ct2/results?cond=&term=lomitapide&cntry1=&state1=&SearchAll=Search+all+studies&recrs=")
    browser.find_element_by_id("save-list-link").click()
    browser.find_element_by_id("submit-download-list")
    

提交回复
热议问题