E AttributeError: type object 'By' has no attribute 'ACCESSIBILITY_ID'
时间: 2023-10-06 13:12:43 浏览: 97
问题中的错误信息是"E AttributeError: type object 'By' has no attribute 'ACCESSIBILITY_ID'"。
根据引用的源码改动,我们可以看到,在最新的WebDriver库中,By模块的访问性ID属性已被移除。因此,如果您在代码中尝试使用By.ACCESSIBILITY_ID,就会报错。
为了解决这个问题,您可以使用其他可用的定位策略来代替访问性ID。您可以尝试使用其他定位方法,如By.ID、By.NAME、By.XPATH、By.CSS_SELECTOR等。具体使用哪种方法取决于您的需求和页面结构。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Pywinauto 应用后端类型选择错误:AttributeError: ‘NoneType‘ object has no attribute ‘backend‘....](https://blog.csdn.net/qq_38161040/article/details/100882561)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id](https://blog.csdn.net/weixin_44745809/article/details/125913755)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文