1、获取元素文本返回值为空的代码
def askfor_leave_list_reason_perc(self):
sleep(1)
self.switch_iframe(AFLL.AskforLeave_list_iframe[0], doc="请假列表iframe")
Table_tbody = "//div[@id='table_635d6db0595d11ebbecee70b85d7da5f']//div[@class='el-table__fixed']//tbody"
element = self.driver.find_element_by_xpath(Table_tbody)
table_tr_list = element.find_elements_by_tag_name("tr")
total_numbers = len(table_tr_list)
print("列表总数据:{}".format(total_numbers))
sleep(1)
table_list = []
for i in range(total_numbers):
table_td_list = self.driver.find_elements_by_xpath('//div[@id="table_635d6db0595d11ebbecee70b85d7da5f"]//div[@class="el-table__fixed"]'
'//tbody//tr[' + str(i + 1) + ']//td[4]'