Created
November 30, 2022 14:51
-
-
Save lyf-is-coding/e50709df3fff9a66b6c9274d1e0bbbc8 to your computer and use it in GitHub Desktop.
Python Selenium Wait for an element tobe loaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def WaitForElement(selector, text : str, delay : int): | |
try: | |
WebDriverWait(driver, delay).until(EC.presence_of_element_located((selector, text))) | |
print("Found element!") | |
return True | |
except TimeoutException: | |
print("Couldn't find element!") | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment