Skip to content

Instantly share code, notes, and snippets.

@lyf-is-coding
Created November 30, 2022 14:51
Show Gist options
  • Save lyf-is-coding/e50709df3fff9a66b6c9274d1e0bbbc8 to your computer and use it in GitHub Desktop.
Save lyf-is-coding/e50709df3fff9a66b6c9274d1e0bbbc8 to your computer and use it in GitHub Desktop.
Python Selenium Wait for an element tobe loaded
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