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:

http://xpathvisualizer.codeplex.com/


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -