title: Set up a real timeout for loading page in Selenium WebDriver?
body: <p>I'm testing a site with lots of proxies, and the problem is some of those proxies are awfully slow. Therefore my code is stuck at loading pages every now and then. </p>
  
  <pre><code>from selenium import webdriver
  
  browser = webdriver.Firefox()
  browser.get("http://example.com/example-page.php")
  element = browser.find_element_by_id("someElement")
  </code></pre>
  
  <p>I've tried lots of stuff like <code>explicit waits</code> or <code>implicit waits</code> and been searching around for quite a while but still not yet found a solution or workaround. Nothing seems to really affect page loading line <code>browser.get("http://example.com/example-page.php")</code>, and that's why it's always stuck there.</p>
  
  <p>Anybody got a solution for this? </p>
  
  <p><strong>Update 1:</strong> </p>
  
  <p>JimEvans' answer solved my previous problem, and <a href="http://code.google.com/p/selenium/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&amp;groupby=&amp;sort=&amp;id=687" rel="noreferrer">here</a> you can find python patch for this new feature. </p>
  
  <p><strong>New problem:</strong> </p>
  
  <pre><code>browser = webdriver.Firefox()
  browser.set_page_load_timeout(30)
  
  browser.get("http://example.com/example-page.php")
  
  element = browser.find_element_by_id("elementA")
  element.click() ## assume it's a link to a new page http://example.com/another-example.php
  
  another_element = browser.find_element_by_id("another_element")
  </code></pre>
  
  <p>As you can see <code>browser.set_page_load_timeout(30)</code> only affects <code>browser.get("http://example.com/example-page.php")</code> which means if this page loads for over 30 seconds it will throw out a timeout exception, but the problem is that it has no power over page loading such as <code>element.click()</code>, although it does not block till the new page entirely loads up, <code>another_element = browser.find_element_by_id("another_element")</code> is the new pain in the ass, because either <code>explicit waits</code> or <code>implicit waits</code> would wait for the whole page to load up before it starts to look for that element. In some extreme cases this would take even <strong>HOURS</strong>. What can I do about it?</p>