tags:

views:

44

answers:

1

In my webpage, there's a div class named Test. How can I find it with XPath? or am I doing it wrong?

+3  A: 

This selector should work but will be more efficient if you replace it with your suited markup:

//*[contains(@class, 'Test')]
meder
with my suited markup? Sorry, I'm not sure what did that part mean.
Doug
It means that I gave you a generic non-efficient answer that should work, but because you provided no xml whatsoever I couldn't make it efficient so you would have to suite it towards your markup. And did it work?
meder
I'll have to get back to you on that question.
Doug
@meder: More like `//div[contains(concat(' ', @class, ' '), ' Test ')]` - Yours will turn up partial matches as well.
Tomalak
your xpathfu is strong :)
meder