Reputation: 424
I use selenium in python to read table data from a website. I want to get data1
and data2
.
I use the code like below. But I can only get the data2, the first code will print nothing. Can anyone tell me how to solve this problem? Thank you.
elem = browser.find_element_by_css_selector('td.el-table_1_column_1.is-hidden div')
print(elem.text)
elem = browser.find_element_by_css_selector('td.el-table_1_column_2 div')
print(elem.text)
<td class="el-table_1_column_1 is-hidden">
<div class="cell">data1</div>
</td>
<td class="el-table_1_column_2 ">
<div class="cell">data2</div>
</td>
Upvotes: 1
Views: 549