case:今天获取列表内容的时候定位错误以及对table了解不透彻
1)定位表格中的行时,写法如下
table = driver.find_element_by_xpath("//div[@class='d-table-body']/table")
rows = table.find_elements_by_tag_name("tr")
print rows
rowname = []
for row in rows[1:]: # table中含有表头,将表头的tr过滤掉
col = row.find_element_by_xpath("td[1]/a") #这个定位前面不需要加//
table中带有带有 thead、tbody 以及 tfoot 元素,所以获取元素的时候要注意