Suppose I have an HTML that looks like this:
<div class="first second">
Right!
</div>
<div class="first second third fourth">
Wrong!
</div>
<div class="first second">
Right!
</div>
If I try to locate the first and third div, using css:
driver.find_elements_by_class_name("first, second")
Instead of getting 2 elements in my list, I get all the three divs because the second one actually contains those classes and some others... How can I restrict it, to locate only the <div>
s with:
class = "first second"