我需要使用selenium和智能卡(opensmc)以及firefox驱动程序。 后:
...
driver.get("mypage")
driver.find_element_by_link_text("login")
# Here comes the enter pin window (popup)
...
驱动程序阻止。 opensmc驱动程序发送的进入智能卡引脚窗口似乎存在问题。
要解决此问题,请使用xdotool
输入密钥。
现在,在选择任何元素或切换到任意页面时,我会收到tryUnexpectedAlertPresentException
:
driver.find_element_by_link_text("logout")
driver.get("http://google.com")
# each throws the tryUnexpectedAlertPresentException
另一方面:
alert = driver.switch_to_alert()
alert.dismiss()
抛出NoAlertPresentException
无论如何,进一步find_element
会导致tryUnexpectedAlertException
请您解释一下这种行为以及如何解决这个问题?