How to get html elements with multiple css classes -
i know how list of divs of same css class e.g
<div class="class1">1</div> <div class="class1">2</div>
using xpath //div[@class='class1']
but how if div have multiple classes, e.g
<div class="class1 class2">1</div>
what xpath then?
the expression you're looking is:
//div[contains(@class, 'class1') , contains(@class, 'class2')]
i highly suggest xpath visualizer, can debug xpath expressions easily. can found here:
Comments
Post a Comment