Selenium不检测具有多个按钮的modalbox

2024-10-08 22:27:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我的代码

submit.click()
try:            
  element=WebDriverWait(driver,10).until
  (EC.presence_of_element_located ((By.ID, "continueConfirmation")))
  alert1=driver.switch_to_alert()
  alert1.accept()
except TimeoutException:
  print("no alert")
  driver.close() 

它在alert1.accept()上没有给我NoAlertexception,我不知道为什么,我添加了等待,是因为弹出对话框有两个按钮吗


Tags: of代码driveralertelementuntilclicksubmit

热门问题