I'm trying to figure out how to access HTML elements in a nested fashion through Selenium and Python.
For example I have:
box = driver.find_element_by_tag_name('tbody')
which represents the body of the data I'd like to mine. I'd like to iterate through each row in this body (each row characterized by a <tr>
tag) using something like:
for driver.find_element_by_tag_name('tr') in box:
But obviously that's not possible because box is a Selenium object and is non-iterable.
What's the best way to do something like this?