PYTHON+selenium学习日志

PYTHON+selenium学习日志,第1张

报错: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)

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/736349.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-28
下一篇2022-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存