find_element和find_elements

find_element,返回1个对象

find_elements,返回一个列表,里面包含多个对象

因此当你想对一个对象进行操作时,不能使用find_elements的表达方式,pychram会提示你:list没有click属性(AttributeError: 'list' object has no attribute 'click')

正确使用如下:

browser.find_element_by_xpath('//*[@id="headIDlistTable"]/th[1]/div/input').click()
posted @ 2018-05-11 17:50  胡同秀_容儿  阅读(586)  评论(0编辑  收藏  举报