Traceback (most recent call last)?TOC
#selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined
python+selenium 运行报错,定位元素的方法都正确,但就是找不到元素,

下面是解决办法
查看项目配置

这里提示selenium可以升级
打开dos窗口
先找到python的安装路径

进入到python安装路径

查看目前安装的工具 pip list

发现selenium不是最新版,把它卸载掉pip uninstall selenium


再查看,已经卸载成功

安装指定版本的selenium
pip install selenium==4.0.0a1
查看已经安装成功

现在再运行脚本,就没有问题了。










