这个窗口点击之后,窗口会自动关闭。会出现弹出框。
无法使用selenium确认点击确认。
会跳转到主窗口,但是会出现错误。
错误提示。没有这样的窗口:目标窗口已经关闭、
如何点击这个确定弹出窗口。
这个窗口点击之后,窗口会自动关闭。会出现弹出框。
无法使用selenium确认点击确认。
会跳转到主窗口,但是会出现错误。
错误提示。没有这样的窗口:目标窗口已经关闭、
如何点击这个确定弹出窗口。
用execute_script()注入js,重新定义window.alert()函数,就不会弹出对话框了
driver=webdriver.Chrome()
driver.get("http://xxxxxxxxxxx")
driver.execute_script('''
window.alert = function (str) {
console.log(str);
};
''')