title: How to re-load page while looping over elements?
body: <p>This is my code, should be easily recreateable:</p>
  <pre><code>import time
  from selenium import webdriver
  from selenium.webdriver.chrome.service import Service
  from selenium.webdriver.chrome.options import Options
  
  
  def main():
      # Setup chrome options
      chrome_options = Options()
      chrome_options.add_argument(&quot;--headless&quot;)  # Ensure GUI is off
      chrome_options.add_argument(&quot;--no-sandbox&quot;)
      chrome_options.add_argument(&quot;--window-size=1920x3500&quot;)
  
      # Set path to chromedriver as per your configuration
      webdriver_service = Service(&quot;/home/sumant/chromedriver/stable/chromedriver&quot;)
  
      # Choose Chrome Browser
      driver = webdriver.Chrome(service=webdriver_service, options=chrome_options)
      driver.maximize_window()
  
      # Get page
      url =  &quot;https://www.ibrance.com/&quot;
      driver.get(url)
      time.sleep(2)
      ele = driver.find_elements_by_tag_name('a')
      for i, e in enumerate(ele):
          try:
              print(e.get_attribute('outerHTML'))
              e.click()
              time.sleep(2)
              driver.save_screenshot(f&quot;/mnt/d/Work/ss{i}.png&quot;)
              driver.get(url)
              # driver.refresh()
          except:
              print(&quot;element not interactable&quot;)
      
      driver.close()
      driver.quit()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>The idea is I click on a link take a screenshot, load home page again, click on next link and so on.
  After the first link, it is not able to find any other element on the reloaded page.</p>