title: Python Selenium: wait until an element is no longer stale?
body: <p>I have a situation in which I want to wait until an element is no longer STALE i.e. until an elements gets connected to the DOM. Following wait options do not work somehow:</p>
  
  <pre><code>self.wait.until(EC.visibility_of_element_located((By.ID, "elementID")))
  self.wait.until(EC.presence_of_element_located((By.ID, "elementID")))
  </code></pre>
  
  <p>Its opposite wait function is present which waits until an element becomes stale, which is:</p>
  
  <pre><code>self.wait.until(EC.staleness_of((By.ID, "elementID")))
  </code></pre>
  
  <p>But I want it to wait until the element is NO LONGER STALE i.e. until it gets connected to the DOM. How can I achieve this functionality?</p>
  
  <p>EDIT: there is a solution here : <a href="http://darrellgrainger.blogspot.com/2012/06/staleelementexception.html" rel="noreferrer">here</a> but I am looking for any other better approach if any.</p>