如何使用Python + Selenium在警报中单击“确定”按钮 由 ~签名发布于 2020-05-18 07:08:01 我想在此弹出对话框中单击“确定”按钮 我试过了: driver.switchTo().alert().accept(); 但这不起作用
To click on the OK button within the alert you need to induce WebDriverWait for the desired
alert_is_present()
and you can use the following solution:注意:您必须添加以下导入:
参考
您可以在以下位置找到一些相关的讨论: