Answer the question
In order to leave comments, you need to log in
How to parse "Color" in table from div using xpath for datacol?
Need xpath for datacol.
Table code example
<div class="item-card-detailed__table">
<div class="item-card-detailed__table_column">
<div class="item-card-detailed__table_item">Длина (см)</div>
<div class="item-card-detailed__table_item">Ширина (см)</div>
<div class="item-card-detailed__table_item">Высота (см)</div>
<div class="item-card-detailed__table_item">Материал</div>
<div class="item-card-detailed__table_item">Цвет</div>
<div class="item-card-detailed__table_item">Вес (кг)</div>
<div class="item-card-detailed__table_item">Стили</div>
</div>
<div class="item-card-detailed__table_column item-card-detailed__table_column-second">
<div class="item-card-detailed__table_item">62</div>
<div class="item-card-detailed__table_item">56</div>
<div class="item-card-detailed__table_item">85</div>
<div class="item-card-detailed__table_item">Ткань</div>
<div class="item-card-detailed__table_item">Бежевый</div>
<div class="item-card-detailed__table_item">11</div>
<div class="item-card-detailed__table_item">Прованс, Скандинавский</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Use nested queries and the task becomes quite trivial:
XPath
//div[@class = 'item-card-detailed__table_column item-card-detailed__table_column-second']/div[position() = count(//div[@class = 'item-card-detailed__table_column']/div[text() = 'Цвет']/preceding-sibling::div)+1]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question