I'm trying to parse a html file. There are many nested divs in this html. I want to get all child divs, but not grandchildren etc.
Here is a pattern:
<div class='main_div'> <div class='child_1'> <div class='grandchild_1'></div> </div> <div class='child_2'> ... ... </div>
So the command I'm looking for would return 2 elements - divs which classes are 'child_1' and 'child_2'.
Is it possible?
I've tried to use
main_div.find_elements_by_tag_name('div') but it returned all nested divs in the div.