from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome()
driver.get('https://merch.heemoney.com/Account/Login')
driver.find_element_by_id('txtLoginAccount').send_keys('jiatest001')
driver.find_element_by_id('txtPassword').send_keys('123456')
driver.find_element_by_id('txtPassword').send_keys(Keys.ENTER)
driver.switch_to_alert().text()
time.sleep(5)
print(driver.switch_to_alert().text())
time.sleep(5)
以上代码总会返回失败,找不到警告框,求解中