如何使用Python + Selenium在警报中单击“确定”按钮

我想在此弹出对话框中单击“确定”按钮

enter image description here

我试过了:

driver.switchTo().alert().accept(); 

但这不起作用