See css selectors on w3schools.com
Selenium converts class_name
to css selector
but class_name()
expects single name and Selenium has problems when there are two or more names. When it converts class_name
to css_selector
then it adds dot
only before first name but it needs dot
also before second and other names. So you have to manually add second dot
class_name("css-ixatld.e1cc71bi0")
See if this works:
meanings = driver.find_elements_by_xpath(".//div[@id='meanings']/div[@data-testid='word-grid-container']/ul/li")for e in meanings:e.find_element_by_tag_name("a").click()//Add a implicit wait if you needdriver.back()