【发布时间】:2013-02-04 06:53:56
【问题描述】:
当我使用 selenium webdriver 打开一个页面时,我得到一个 chrome 对话框“选择证书”。默认证书是正确的,所以我只需单击“确定”按钮。但我有这个问题。我有python代码:
drv = webdriver.Chrome()
drv.get("https://example.com/login")
然后我想做类似的事情:
drv.switch_to_alert().accept()
或
drv.switch_to_alert().send_keys(Keys.TAB)
drv.switch_to_alert().send_keys(Keys.SPACE)
问题是代码在 drv.get("https://example.com/login") 行停止执行。 Webdriver 正在等待页面加载。在该行之前没有 chrome 对话框。
我该如何处理?
【问题讨论】:
标签: google-chrome selenium python-2.7 certificate webdriver