Here's an example that finds div elements whose className contains atag
:
//div[contains(@class, 'atag')]
Here's an example that finds div elements whose className contains atag
and btag
:
//div[contains(@class, 'atag') and contains(@class ,'btag')]
However, it will also find partial matches like class="catag bobtag"
.
If you don't want partial matches, see bobince's answer below.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…