【问题标题】:TypeError: object of type 'WebElement' has no len()TypeError:“WebElement”类型的对象没有 len()
【发布时间】:2020-11-16 09:11:51
【问题描述】:

我得到了这个错误,我已经将元素更改为css,id并且错误仍然存​​在

chekboxes = driver.find_element_by_xpath("//input[@type='checkbox']")
print(len(chekboxes))

【问题讨论】:

    标签: python selenium testing automation


    【解决方案1】:

    find_element_by_xpath(用于搜索单个元素)替换为find_elements_by_xpath(用于搜索元素列表)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-21
      • 1970-01-01
      • 2019-05-23
      • 2013-04-18
      • 2015-01-21
      • 2021-12-19
      • 2018-08-26
      相关资源
      最近更新 更多