S
S
sivabur2015-05-11 22:16:18
XPath
sivabur, 2015-05-11 22:16:18

How to get elements of a certain class (xpath)?

how to get the

<a class="class1 class2"> 
<i class="class1 class4 class5">
<b class="class1">
<a class="class1-class7">

so that only those tags with the class class1 are selected? (all except the last one)
//*[contains(@class, 'class1')].  не подходит берет последний элемент
//*[@class= 'class1'].  не подходит

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2015-05-21
@sivabur

What about such an option?

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

S
sivabur, 2015-05-22
@sivabur

No, it was printed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question