title: Python, selenium - how to refresh page until item found?
body: <p>I am trying to refresg page until item appears but my code doesn't work (I took pattern on that: <a href="https://stackoverflow.com/questions/42683692/python-selenium-keep-refreshing-until-item-found-chromedriver">python selenium keep refreshing until item found (Chromedriver)</a>).</p>
  
  <p>Here is the code:</p>
  
  <pre><code>while True:
      try:
          for h1 in driver.find_elements_by_class_name("name-link"):
              text = h1.text.replace('\uFEFF', "")
              if "Puffy" in text:
                  break
      except NoSuchElementException:
          driver.refresh
      else:
          for h1 in driver.find_elements_by_class_name("name-link"):
              text = h1.text.replace('\uFEFF', "")
              if "Puffy" in text:
                  h1.click()
                  break
          break
  </code></pre>
  
  <p>These fragment is because I have to find one item with the same class name and replace BOM with "" (<code>find_element_by_partial_link_text</code> didn't work).</p>
  
  <pre><code>for h1 in driver.find_elements_by_class_name("name-link"):
      text = h1.text.replace('\uFEFF', "")
      if "Puffy" in text:
          break
  </code></pre>
  
  <p>Could someone help me? Thanks a lot.</p>