在使用selenium的定位web元素的时候,有时候会提示找不到定位元素,报错:selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {“method”:“css selector”,“selector”:".el-button login_btn el-button–primary el-button–medium"}
关于元素定位使用class_name定位报错的部分问题Unable to locate element: {“method“:“css selector“
然后我们检查发现从web上获取的元素的class_name并没有错
这里只需要做一个小改动就可以正常获取到元素了,我们只需要把class_name里面的空格间隔符替换成英文的“.”就可以了
关于元素定位使用class_name定位报错的部分问题Unable to locate element: {“method“:“css selector“
再次执行代码就会发现不再会报错了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-08-14
  • 2021-10-17
  • 2022-12-23
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-12-08
  • 2021-04-17
相关资源
相似解决方案