python+selenium 获取table列表中所有数据条数



# 定位到table,并获得table中所有得tr元素
menu_table = self.driver.find_element_by_xpath("//div[@class='datagrid-view1']/div[2]/div/table")

rows = menu_table.find_elements_by_tag_name('tr')

# python 得len()函数返回对象(字符、列表、元组)得长度或者元素得个数

before_add_numbers = len(rows)
print(before_add_numbers)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM