title: python selenium hangs on finding nonexistent elements
body: <p>I'm using selenium with Python and it always freezes when I search for an element that does not exist. I've really tried everything (Firefox version 17.0.1):</p>
  
  <pre><code>&gt;&gt;&gt; import selenium
  &gt;&gt;&gt; selenium.__version__
  '2.26.0'
  &gt;&gt;&gt; from selenium import webdriver
  &gt;&gt;&gt; from selenium.webdriver.support.ui import WebDriverWait
  &gt;&gt;&gt; ff = webdriver.Firefox()
  &gt;&gt;&gt; ff.implicitly_wait(5)
  &gt;&gt;&gt; ff.set_page_load_timeout(5)
  &gt;&gt;&gt; ff.set_script_timeout(5)
  &gt;&gt;&gt; waiter = WebDriverWait(ff, 5)
  &gt;&gt;&gt; waiter.until(lambda ff: ff.find_element_by_name("foo"))
  </code></pre>
  
  <p>That last command freezes indefinitely. How do I get firefox to simply return None or throw an exception when it doesn't find an element, instead of hanging <strong>forever</strong>? I'm using selenium 2.26.0</p>