在我的学习课程中,我看到了这段代码:
def check_for_row_in_list_table(self, row_text):
table = self.browser.find_element_by_id('id_list_table')
rows = table.find_elements_by_tag_name('tr')
self.assertIn(row_text, [row.text for row in rows])
现在我想知道行的最后一行中的这个文本方法是从哪里来的?排什么类型?
答案 0 :(得分:1)
find_elements_by_tag_name()
方法返回WebElement
objects的列表,row
是WebElement
个对象,.text
是它的属性。