1

I want to know that if i ahve this div tag

<div class="class1 class2 class3" >  some stuff </div>

Then if i mention this //div[@class='class2']

Will it find it or it just only find with single class only

Talvalin
  • 7,789
  • 2
  • 30
  • 40
Mirage
  • 30,868
  • 62
  • 166
  • 261

1 Answers1

1

This has been asked before, but you should use:

//*[contains(concat(' ', normalize-space(@class), ' '), ' class2 ')]

n.b. there are some online tools for evaluating xpaths

Community
  • 1
  • 1
Hedde van der Heide
  • 21,841
  • 13
  • 71
  • 100
  • so u mean `@class="class2"` is equivalent to `contains(concat(' ', normalize-space(@class), ' '), ' class2 ')` so i can use any tag before that i mean //div[contains ... – Mirage Dec 11 '12 at 09:19