locate

How to obtain the number of elements with classname "xyz" through Selenium

How to obtain the number of elements with classname "xyz" through Selenium Question: Is it possible to do something like this? I want to know the number of elements with the class property set to ‘gsc-cursor-page’. pages_nav = driver.find_element_by_css_selector(‘.gsc-cursor’) pages = driver.find_element_by_css_selector(‘.gsc-cursor-page’) for pages in pages_nav: print("len(pages)") As shown below are (.gsc-cursor-page) inside (.gsc-cursor) So …

Total answers: 2