How to get html elements with multiple css classes

前端 未结 4 1466
渐次进展
渐次进展 2020-11-28 06:57

I know how to get a list of DIVs of the same css class e.g

1
2
4条回答
  •  余生分开走
    2020-11-28 07:40

    According to this answer, which explains why it is important to make sure substrings of the class name that one is looking for are not included, the correct answer should be:

    //div[contains(concat(' ', normalize-space(@class), ' '), ' class1 ')
        and contains(concat(' ', normalize-space(@class), ' '), ' class2 ')]
    

提交回复
热议问题