Q:selenium在send_keys时报错dict object has no attribute 'send_keys',如下图
增加了print(type(e1))发现确实是字典类型,怪了,按道理e1的type应该是selenium.webdriver.remote.webelement.WebElement才对,怎么会变成dict字典呢?
我网上查了,按照(115条消息) Python运行selenium时报错‘dict‘ object has no attribute ‘send_keys‘解决fang‘an_翔空中,策人生的博客-CSDN博客说,肯定不是find_element_by_NAME,因为这个selenium包是我云桌面外的,外面运行正常的!
至于版本:
更换成对应版本,更换之后确实可以了
CNPM Binaries Mirror (npmmirror.com)
原因:selenium所用浏览器驱动是python.exe同层的那个,要保持与浏览器版本对应才行
解决:换成对应版本浏览器驱动,放到python.exe同层即可
- attribute send_keys selenium 时报 objectattribute send_keys selenium时报 find_element_by_id quot send_keys selenium 39 attribute strftime object identifier attribute resource时报 39 attribute nonetype object get_attribute attribute selenium属性 find_element_by_xpath attribute selenium element object valueerror selenium错误 send_keys 快捷键pywinauto send_keys键盘