0
我试图自动执行此网站中的搜索过程:https://www.bcbsga.com/health-insurance/provider-directory/searchcriteria 该过程涉及单击“继续”按钮以在“访客”模式下进行搜索。下一页获得了用于优化搜索条件的下拉项目列表。我的代码要么产生“元素不可见”异常(我通过等待纠正)或超时。请帮忙。Python Selenium Webdriver选择下拉值
这里是我的代码:
# navigate to the desired page
driver.get("https://www.bcbsga.com/health-insurance/provider-directory/searchcriteria")
# get the guest button
btnGuest = driver.find_element_by_id("btnGuestContinue")
#click the guest button
btnGuest.click()
wait = WebDriverWait(driver,10)
#Find a Doctor Search Criteria page
element = wait.until(EC.visibility_of_element_located((By.ID,"ctl00_MainContent_maincontent_PFPlanQuestionnaire_ddlQuestionnaireInsurance")))
lstGetInsurance = Select(element)
lstGetInsurance.select_by_value("BuyMyself$14States")
# close the browser window
#driver.quit()
感谢很多您的解决方案 - 它的作品!我想知道我以前的代码有什么问题。任何指针?我曾尝试通过可见文本进行选择。 – Srikanth
您使用的ID是'选择'ID,但选择存储在'输入'中。 – Anton