title: Stop infinite page load in selenium webdriver - python
body: <p>I am loading a page using selenium web driver.But the page is loading infinitely.
  I tried to catch the exception and simulate the esc key action but that didn't helped.Due to some constraints I can use only Firefox[I have seen the chrome add on solution]. Once I hit the page I am not getting the control back.</p>
  
  <p>I set my Firefox profile as </p>
  
  <pre><code>    firefoxProfile = FirefoxProfile()
      firefoxProfile.set_preference('permissions.default.stylesheet', 2)
      firefoxProfile.set_preference('permissions.default.image', 2)
      firefoxProfile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so','false')
      firefoxProfile.set_preference("http.response.timeout", 10)
      firefoxProfile.set_preference("dom.max_script_run_time", 10)
  </code></pre>
  
  <p>Script to stop loading :</p>
  
  <pre><code> try:
         driver.set_page_load_timeout(10)
         driver.get('http://www.example.com'     
   except Exception
          print 'time out'
          driver.send_keys(Keys.CONTROL +'Escape')
  </code></pre>