How to get html elements with multiple css classes

前端 未结 4 1454
渐次进展
渐次进展 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:25

    The expression you're looking for is:

    //div[contains(@class, 'class1') and contains(@class, 'class2')]
    

    I highly suggest XPath visualizer, which can help you debug xpath expressions easily. It can be found here:

    http://xpathvisualizer.codeplex.com/

提交回复
热议问题