XPath selector for matching multiple classes

I have been looking for the last 30 minutes or so, but I can not answer the question of how to create an xpath selector that will correspond to several classes.

After reading this: How can I match an attribute containing a specific string?

The closest solution I can find is:

//div[contains(@class,'atag') and contains(@class ,'btag')] 

However, one of the comments suggests that it will also match:

 <div class="Patagonia Halbtagsarbeit"> 

Which XPath selector should be used to select divs with multiple classes?

Example:

 <div class="fl badge bolded shadow"> 
+4
source share
1 answer

I would like to offer xpath support to find the div more specifically so that other divs with the same classes cannot be selected. You can use FireBug FirePath to get an absolute xpath.

0
source

Source: https://habr.com/ru/post/1495070/


All Articles