码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2020-07-28 17:25:27      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:sele   tag   个数   pat   element   获得   grid   log   selenium   

# 定位到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)

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

标签:sele   tag   个数   pat   element   获得   grid   log   selenium   

原文地址:https://www.cnblogs.com/zhuzhaoli/p/13391316.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!