does someone know how to wait until the page is loaded? I tried all possible variants I found on the web but is simply does not work.
I need to wait after I trigger a cl
Here's my version that I have used:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def waitForLoad(inputXPath):
Wait = WebDriverWait(browser, PATIENCE_TIME)
Wait.until(EC.presence_of_element_located((By.XPATH, inputXPath)))
The top line in the function is a generic wait. The second one is an expected conditions where it is trying to find an element that you know exists on the page. You can change it so instead of Xpath it does CSS_SELECTOR, NAME, ID, CLASS, etc. there are many others, but you'd have to look up the expected conditions documentation. Hope that helped, it helped me when I figured it out.