title: Selenium Python can't find the element
body: <p>I want to find the element and check its stock status, but cannot find the element</p>
  <p><a href="https://i.stack.imgur.com/4zu4r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4zu4r.png" alt="website screenshot" /></a></p>
  <p><a href="https://i.stack.imgur.com/YYLxz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYLxz.png" alt="website screehshot 2" /></a></p>
  <p><a href="https://i.stack.imgur.com/kylxY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kylxY.png" alt="website screenshot 3" /></a></p>
  <p><a href="https://i.stack.imgur.com/lLcYo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lLcYo.png" alt="website screenshot 4" /></a></p>
  <p>my code:</p>
  <pre><code>while staleElement:
  
      driver.get(list_url) 
  
      list_items = driver.find_elements_by_xpath('//li[@class=&quot;a-spacing-none g-item-sortable&quot;]')
  
      for item in list_items:
          basket = False
          try:
              basket = item.find_elements_by_xpath('//a[@class=&quot;a-button-text a-text-center&quot;]')
          except exceptions.StaleElementReferenceException as e:
              basket = item.find_elements_by_xpath('//a[@class=&quot;a-button-text a-text-center&quot;]')
  
          print(basket[0].text)
  </code></pre>
  <p>console:</p>
  <p><a href="https://i.stack.imgur.com/Hs0Cg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hs0Cg.png" alt="SS" /></a></p>