title: FInding the latest message in a list of messages
body: <p>so im currently trying to copy a message to automate a login sequence. The login requires an otp code that has to be sent to a phone. I set up a textnow account to gain access to the otp via web page but the problem comes in when trying to find the latest message. How could I specify that I want the latest element copied even though the html for each individual message looks exactly the same. The only thing that differentiates them is the otp given and time.</p>
  
  <p>How could I identify the latest message to the bot and copy it ?<a href="https://i.stack.imgur.com/gpXXo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gpXXo.png" alt="enter image description here"></a></p>
  
  <pre><code>senderofotp = driver.find_element_by_xpath('//*[@id="chat-preview-list"] /ul/li[1]/div[2]/div[1]/span/div')
  senderofotp.click()
  </code></pre>
  
  <p>The code above is how I selected the sender of the message. </p>
  
  <pre><code>message = driver.find_element_by_xpath('//*[@id="messageView"]/ul/li[30]/div/div[1]/div/div[1]/div/span/span')
  </code></pre>
  
  <p>even when I try to grab the message it gives me the xpath to the message view as a whole </p>