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