这个python object.text方法来自哪里?

时间:2016-04-18 18:15:48

标签: python django selenium tdd

在我的学习课程中,我看到了这段代码:

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])

现在我想知道行的最后一行中的这个文本方法是从哪里来的?排什么类型?

1 个答案:

答案 0 :(得分:1)

find_elements_by_tag_name()方法返回WebElement objects的列表,rowWebElement个对象,.text是它的属性。