title: How to find the last element inside same divs in selenium python
body: <p>I am trying to find the last element inside a div, print it to the console and wait for the next one to generate, using selenium. I have tried for and while loops but they do not work. also, it selects only the first one. I want to select every time the last one. </p>
  
  <p>In the example below: </p>
  
  <pre><code>    &lt;div class="row"&gt;
          &lt;div class="col"&gt;
              This is the first text
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;div class="col"&gt;
              This is the second text
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to find every time <code>This is the second text</code> and if generates another <code>This is the third text</code> and so on. I have tried this, but it does not work. <code>myText = browser.find_element_by_xpath("//div[@class='col']").text</code></p>
  
  <p>Please at least pseudo code for this loop in python.</p>
  
  <p>How to write a simple python code for this which gets the last text and prints it to the console. and then waits until another one generates and so on.</p>