from AttributeError: 'WebDriver' object has no attribute 'switchTo' 解决方法
使用selenium框架进行chrome模拟操作时,可能会需要点击弹出的alert。
在网上搜到的代码是driver.switchTo().alert().accept(),运行报错
解决方法:
改为chrome.switch_to.alert.accept()
from AttributeError: 'WebDriver' object has no attribute 'switchTo' 解决方法
使用selenium框架进行chrome模拟操作时,可能会需要点击弹出的alert。
在网上搜到的代码是driver.switchTo().alert().accept(),运行报错
解决方法:
改为chrome.switch_to.alert.accept()