selenium.common.exceptions.NoSuchElementException: Message: no such element的解决方法


笔者在爬取网页时遇到了selenium.common.exceptions.NoSuchElementException: Message: no such element的错误,提出以下解决方法

 

 这里其实是由两个类(class)组成的div,而在find_element_by_class_name()方法中只能选择一个类名。所以把代码

 

 改成(即去掉item空格后面的内容)

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM