'What is the command in selenium python that says wait for all elements on page to load?

Is there a code in selenium python that says wait for all elements on page to load?. If so what is the code?.



Solution 1:[1]

webdriver will wait for a page to load by default.

It does not wait for loading inside frames or for ajax requests. It means when you use .get('url'), your browser will wait until the page is completely loaded and then go to the next command in the code. But when you are posting an ajax request, webdriver does not wait and it's your responsibility to wait an appropriate amount of time for the page or a part of page to load; so there is a module named expected_conditions.

Solution 2:[2]

Use the following ex with selecting specific element in the page to wait:

try:
    element_present = EC.presence_of_element_located((By.ID, 'element_id'))
    WebDriverWait(driver, timeout).until(element_present)
except TimeoutException:
    print "Timed out waitingenter code here" 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Akzy
Solution 2 Software Tester at ExpandCart