Wait for page load in Selenium (Python)

Wait for page load in Selenium (Python)

To wait until the page is loaded, the easiest way is to use a WebDriverWait to force the driver to wait until an element is visible that you know is only present on the page you are navigating to.

wait = WebDriverWait(self.driver, 10)
element = wait.until(ec.visibility_of_element_located((By.ID, "searchInput")))

Leave a reply

Your email address will not be published. Required fields are marked*

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
5 + 3 =

Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.