JavaScript
x
9
1
<table id="tbl-orderNumber" class="ui-jqgrid-btable">
2
<tbody>
3
<tr class = "jqgfirstrow"></tr>
4
<tr id ="AAAA"></tr>
5
<tr id ="BBBB"></tr>
6
<tr id ="CCCC"></tr>
7
</tbody>
8
</table>
9
i have try but not work. Cannot get all id of tr AAAA, BBBB, CCCC. Thanks
JavaScript
1
2
1
driver.find_elements(By.CSS_SELECTOR, 'tbl-orderNumber')
2
Advertisement
Answer
I prefer to use xpath to do the all things:
JavaScript
1
3
1
for row in driver.find_elements_by_xpath('//table[@id="tbl-orderNumber"]//tr'):
2
print(row.get_attribute('id'))
3