How to access Selenium elements as soon as they are available, rather than waiting for the whole page to load
<pre><code>driver = webdriver.Chrome()
#driver.set_page_load_timeout(10)

driver.get("sitename.com")

driver.find_element_by_id("usernameId").send_keys("myusername")
</code></pre>

<p>Setting a page load time proved counterproductive as the page load was killed even before the elements were actually loaded!</p>

<p>Currently, when I try to login on a site, the find_element_by_id() waits for the complete page to load, then gets me the element. I've read about implicit/explicit waits used along with ExpectedConditions, but as far as I understand they are used for waiting for an element to appear(dynamically) after the complete page has loaded. </p>

<p>Is there a way I can find an element as soon(polling is good enough) as it is visible(without waiting for the complete page to load)? It would be great to do so, some pages take quite a while to load(heavy traffic/low availability/poor internet connection could be reasons though).
I am using Selenium with Python, and a Chrome Driver. Thanks.</p>

<p>Take a look at <a href="http://selenium-python.readthedocs.io/waits.html" rel="nofollow">selenium python documentation</a>.</p>

<p>It has visibility_of_element_located.</p>

<pre><code>from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 10)
element = wait.until(EC.visibility_of_element_located((By.ID,'someid')))
</code></pre>

python selenium selenium-chromedriver