I have some HTML which looks like this one:
<div class="class1">
<div class="some multiple classes here">
<div class="some multiple classes here">
<ul class="other classes">
<li>
<div class="random">some text1</div>
<div class="random1">some text2</div>
<div class="random2">some text3</div>
</li>
<li>
<div class="random">some text4</div>
<div class="random1">some text5</div>
<div class="random2">some text6</div>
</li>
<li>
<div class="random">some text7</div>
<div class="random1">some text8</div>
<div class="random2">some text9</div>
</li>
<!-- here can appear more <li></li> elements -->
</ul>
</div>
</div>
</div>
The situation is a little bit complex:
- first, there are only a few
<li></li>tags with the same<div>classes inside but different text. More,<li></li>(with the samedivs) appear as time passes.
I struggled to find a solution of retrieving all some textX elements in a single loop (not necessary if not possible) using xpath and selenium but I couldn't find a away. More, when I finish all the <li></li> tags, I'd like to just wait for others to appear and take some actions.
The pseudo-code would be the following:
for mydriver.find_element_by_xpath('xpath of ul'):
# here get all the texts
# process them