2024-09-27 21:22:44 发布
网友
在Firefox中,这个弹出窗口(screenshot of the popup)是一种窗口类型的东西,而且我能够将该选项保存为默认值。但在chrome中,它是一种警告性的弹出窗口。如何使用selenium单击此弹出窗口中的按钮
Python警报处理
#Switch the control to the Alert window obj = driver.switch_to.alert #Retrieve the message on the Alert window msg=obj.text print ("Alert shows following message: "+ msg ) #use the accept() method to accept the alert if want to dismiss obj.accept()
或者如果你想放弃它
obj.dismiss()
Python警报处理
或者如果你想放弃它
相关问题 更多 >
编程相关推荐