小编tst*_*pko的帖子

使用selenium webdriver chrome处理'选择数字证书'

当我用selenium webdriver打开一个页面时,我得到一个chrome对话框"选择证书".默认证书是正确的,所以我只需要单击"确定"按钮.但我对此有疑问.我有python代码:

drv = webdriver.Chrome()   
drv.get("https://example.com/login")
Run Code Online (Sandbox Code Playgroud)

之后我想做一些事情:

drv.switch_to_alert().accept()
Run Code Online (Sandbox Code Playgroud)

要么

drv.switch_to_alert().send_keys(Keys.TAB)
drv.switch_to_alert().send_keys(Keys.SPACE)
Run Code Online (Sandbox Code Playgroud)

问题是代码停止在行drv.get(" https://example.com/login ")上执行.Webdriver正在等待页面加载.在该行之前没有chrome对话框.

我怎么处理这个?

selenium google-chrome webdriver certificate python-2.7

12
推荐指数
1
解决办法
6350
查看次数