expected_conditions.elementS_to_be_clickable((By.TAGNAME,'a'))

212 Views Asked by At

I have some webscraping project where I have a code like this:

sleep(1)
meeting_link = driver.find_elements_by_tag_name('a')
meeting_link[25].click()

My question is, how can I use

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.TAG_NAME, 'a'))) 

to return either all of the a tags or the 25th one. Or do I just have to use sleep() instead.

1

There are 1 best solutions below

0
On

The equivalent WebDriverWait command would be :

meeting_link = WebDriverWait(driver, 40).until(EC.visibility_of_all_elements_located((By.TAG_NAME, 'a'))) 

meeting_link is a list, you can click on 25th web element, Just like you did above.