Как использовать css-селектор, чтобы найти последний элемент в тех же элементах каждой строки на python?Я использую пакет pyquery.
Я пробовал tr td:nth-child(2) .score.fill:last-child
, tr td:nth-child(2) .score.fill:nth-last-child(1)
.все не удалось.
<table>
<tbody>
<tr>
<td>Vote A</td>
<td>
<span class="score fill">1</span>
<span class="score">2</span>
<span class="score">3</span>
<span class="score">4</span>
<span class="score">5</span>
</td>
</tr>
<tr>
<td>Vote B</td>
<td>
<span class="score fill">1</span>
<span class="score fill">2</span>
<span class="score fill">3</span>
<span class="score fill">4</span>
<span class="score fill">5</span>
</td>
</tr>
<tr>
<td>Vote C</td>
<td>
<span class="score fill">1</span>
<span class="score fill">2</span>
<span class="score fill">3</span>
<span class="score">4</span>
<span class="score">5</span>
</td>
</tr>
</tbody>
</table>
Я хочу получить такой результат:
<span class="score fill">1</span>
<span class="score fill">5</span>
<span class="score fill">3</span>