title: Selenium WebDriverWait takes too long to find an element on the page
body: <pre><code>WebDriverWait(driver, 90).until(EC.presence_of_element_located((
      By.ID,
      'something-important',
  )))
  thing = driver.find_element_by_id(
      'something-important',
  ).text
  </code></pre>
  
  <p>At this point, I've just followed a link to a new page, so the the page is loading, and I can't just immediately get the 'thing' out of the new page. I know I need to use a wait here, but the wait takes far too long to find the element.</p>
  
  <p>I <em>do</em> want a timeout, because the page might take a long time to load, and I need to handle that. Also if it takes too long, I want it to fail with a timeout exception.</p>
  
  <p>However, in the vast majority of cases, the element is in the page within 3 seconds, but Selenium blocks for around 30 seconds waiting for it to be present. I can see that it is, and I can confirm in the browser that it's there, it just takes ages for the wait to return. How do I stop this? If the element is there within 3 seconds, this should stop blocking very shortly afterwards.</p>
  
  <p>I have tried manually setting a poll frequency of 0.5 seconds, which is apparently the default anyway with the Python selenium bindings, but that doesn't help.</p>
  
  <p>This question seems very similar to <a href="https://stackoverflow.com/questions/24430829/when-the-page-load-for-the-first-time-webdriver-takes-a-long-time-to-find-the">When the page load for the first time , webdriver takes a long time to find the first element</a> - but that one hasn't been answered, and the information there so far hasn't helped me get to a solution yet.</p>