我正在尝试使用 selenium 找到一个 div 内的最后一个元素,将其打印到控制台并等待下一个元素的生成。我已经尝试了for和while循环,但它们不起作用。我希望每次都能选择最后一个。
在下面的例子中。
<div class="row">
<div class="col">
This is the first text
<div class="row">
<div class="col">
This is the second text
我想找到每次This is the second text
,如果产生另一个This is the third text
,以此类推。我已经试过了,但它并不奏效。【替换代码3
请至少用python编写这个循环的伪代码。
如何写一个简单的Python代码,获得最后一个文本并将其打印到控制台。然后等待,直到另一个文本产生,如此循环。