Answer the question
In order to leave comments, you need to log in
How to get an element with a class by pattern/mask (xpath)?
Fits:
<div class="class1-s">
<div class="class1_a">
<div class="class1-s1">
//*[contains(@class, 'class1')]. не подходит берет всё где находит class1qq.
Answer the question
In order to leave comments, you need to log in
<root>
<div class="class1-s">a</div>
<div class="class1_a">b</div>
<div class=" class1+g ">b</div>
<div class="class1-s1">c</div>
<div class="class1-s134">c</div>
<div class="cls1-s134">c</div>
<div class="class1-s134">c</div>
<div c="zclass1-s1">c</div>
<div>c</div>
</root>
/root/div[matches(normalize-space(@class), '^class1..$')]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question