0
点赞
收藏
分享

微信扫一扫

PYTHON+selenium学习日志

吓死我了_1799 2022-04-25 阅读 91
python

报错:selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".hint_PIwZX.c_font_2AD7M"}
  (Session info: chrome=100.0.4896.127)

case1:元素名称不能有空格,把空格换成.就可以了

例如:hint_PIwZX c_font_2AD7M改写为hint_PIwZX.c_font_2AD7M

case2:网页界面还未加载出来。

解决方法:设置元素等待

例如:time.sleep(5) or driver.implicitly_wait(10)

举报

相关推荐

0 条评论