Selenium CSS selector for nth occurrence of td span:nth-child(2)
问题 The css selector td span:nth-child(2) means the 2nd child node span of td . I wanna choose the nth td span:nth-child(2) , something like: driver.find_element_by_css_selector("td span:nth-child(2):eq(4)") I know I can use driver.find_elements_by_css_selector("td span:nth-child(2)")[4] or xpath instead: driver.find_elements_by_xpath('(//td/span[2])[4]') I just wanna know if I can do the same thing with css selector. 回答1: You can't do this with a CSS selector. :eq() is from jQuery and not part