title: selenium failed to reload page with python
body: <p>The reason I am trying to do this is because sometimes if the network is not good, then the loading/refreshing will eventually hang and so I have this idea to at first set a timeout for the chromedriver, then try to catch the exception when the timeout is reached and re-load again.</p>
  
  <p>it's simple code, I am trying to integrate the timeout catch feature into the selenium. 
  It seems the chrome will never really re-load. Even when I changed the timeout to 100 second in the load_page function( which is not in the current code.)</p>
  
  <p>Is it a bug of the chrome driver? Why is it not reloading?</p>
  
  <pre><code>import os
  from selenium import webdriver
  from selenium.common.exceptions import TimeoutException
  from time import sleep
  
  
  def load_page(func, arg, driver):
      load_retry = 0
      while 1:
          if load_retry &gt; 3:
              return False
          try:
              func(arg)
              print('load success!')
              return True
          except TimeoutException:
              load_retry += 1
              print('retrying')
  
              try:
                  driver.execute_script("window.stop();")
              except TimeoutException:
                  sleep(2)
                  continue
  
  
  
  
  chrome = os.path.join('../resources/chromedriver.exe')
  options = webdriver.ChromeOptions()
  # options.set_headless(headless=True)
  driver = webdriver.Chrome(chrome_options=options, executable_path=chrome)
  driver.maximize_window()
  driver.set_page_load_timeout(5)
  
  url = 'http://tieba.baidu.com/f?ie=utf-8&amp;kw=c%2B%2B&amp;fr=search&amp;red_tag=f1842571998'
  
  load_page(driver.get, url, driver)
  
  driver.quit()
  </code></pre>
  
  <p>update:
  I actually did a own re-work with the webdriver.Chrome, basically I just run driver.quit() if I catch the exception, then in next loop start a new  webdriver.Chrome instance again.</p>
  
  <p>It is ugly I think, but it did work.</p>