【发布时间】:2016-11-23 09:11:58
【问题描述】:
我正在尝试自动化此网站中的搜索过程:https://www.bcbsga.com/health-insurance/provider-directory/searchcriteria 该过程涉及单击“继续”按钮以在“访客”模式下进行搜索。下一页有一个下拉项目列表,用于细化搜索条件。我的代码要么产生“元素不可见”异常(我通过等待来纠正)要么超时。请帮忙。
这是我的代码:
# 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()
【问题讨论】:
标签: python selenium-chromedriver