Selenium报错 AttributeError: ‘dict‘ object has no attribute ‘xx‘ (已解决)

selenium的查找元素并点击:self.driver.find_element_by_id("xx").click()

执行这句时报错:AttributeError: 'dict' object has no attribute 'click',断言发现,find_element_by_id确实返回了一个dict类型。

网上寻找答案后,解决如下:

将安装的selenium 4.0版本,降为3.141.0版本即可。

参考:https://stackoverflow.com/questions/69582816/python-selenium-attributeerror-dict-object-has-no-attribute-get-attribute

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码

)">
< <上一篇

)">
下一篇>>