T
T
TechNOIR2018-08-17 00:48:58
XPath
TechNOIR, 2018-08-17 00:48:58

Xpath. How to choose XPath for this case?

Good afternoon.
Can you please tell me if it is possible to choose xpath for this case?
There is a sign, here is its code

<tbody>
<tr class="trow  ">
<td class="sklad">Ростов</td>
<td class="cardAvail">6</td>
<td class="day clock tdmtip" title="В наличии">1</td>
<td class="cost">389,70</td>
</tr>
</tbody>
<tbody>
<tr class="trow  ">
<td class="sklad">Краснодар</td>
<td class="cardAvail">7</td>
<td class="day clock tdmtip" title="В наличии">5</td>
<td class="cost">300,70</td>
</tr>
</tbody>

I need to get the value from cost if sklad is equal to Rostov for example. Ie 389.70
Is it possible with Xpath?
thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Vlastovskiy, 2018-08-17
@TechNOIR

//tr[./td[@class="sklad"] = "Ростов"]/td[@class="cost"]/text()

or
both working options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question