How to specify Xpath that return whole table without last row? -
here code of table. need extract whole table without last row.
whole table:
<table class="product-content__table"> <tr><th class="product-content__th">Состав</th><td>нержавеющая сталь, натуральная кожа </td></tr> <tr><th class="product-content__th">Ширина</th><td>2 см</td></tr><tr><th class="product-content__th">Цвет</th><td>серый </td></tr> <tr><th class="product-content__th">Страна производства</th><td>Россия </td></tr><tr><th class="product-content__th">Сезон</th><td>Мульти </td></tr> <tr><th class="product-content__th">Коллекция</th><td>Весна-лето </td></tr> <tr><th class="product-content__th">Артикул</th><td itemprop="sku">ro003dmcma98</td></tr> </table>
i need extract whole table without row:
<tr><th class="product-content__th">Артикул</th><td itemprop="sku">ro003dmcma98</td></tr>
<td>
sibling of <th>
not child don't need th
in xpath. , want filter out last tr
within same table
instead of filtering out last td
within same tr
:
//table[@class="product-content__table"]//tr[position() < last()]/td
remove trailing /td
if want list of <tr>
instead of <td>
.
Comments
Post a Comment