selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Issue in find_element_by_class_name()

Open 13aksh opened this issue 11 years ago • 1 comments

When we use the function find_element_by_class_name('xyz') then it returns the value of the tags with class = "abc xyz" also. Facing problem because of this issue.

13aksh avatar Jul 12 '15 21:07 13aksh

you need to be more specific with your selector. find_element_by_class_name will return any elements that have "xyz" as a class. it's the same thing as doing:

find_element_by_css_selector('*[class~="xyz"]')

consult the selenium users group for help. these issues are reserved for issues with selenium

ddavison avatar Jul 13 '15 02:07 ddavison