selenium报错:no such element: Unable to locate element

学习selenium,根据link text定位时报错,报错信息如下

Message: no such element: Unable to locate element: {
   
   "method":"link text","selector":"百度首页"}

因为脚本执行到这一行代码时,对应页面上的元素还没加载完成,设置一下等待时间就好了

(估计用其他方法定位也会出现这个问题)

猜你喜欢

转载自blog.csdn.net/weixin_46761622/article/details/123304051