1
link = div.find_element_by_tag_name('a')

How can I use this in the statement

link = WebDriverWait(driver, 10).until(EC.visibility_of_element_located(div.find_element_by_tag_name('a')))

This, doesn't work.

Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38

1 Answers1

1

visibility_of()

visibility_of() is the expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. element is the WebElement returns the (same) WebElement once it is visible.

selenium.webdriver.support.expected_conditions.visibility_of(element)

As visibility_of() takes an element as an argument, you can use the following Locator Strategy:

link = WebDriverWait(driver, 10).until(EC.visibility_of(div.find_element_by_tag_name('a')))
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352