Единственное требование: он должен ссылаться на класс thread-navigation
, потому что на этой странице есть много других элементов пагинации
<section id="thread-navigation" class="group">
<div class="float-left">
<div class="pagination talign-mleft">
<span class="pages">Pages (6):</span>
<span class="pagination_current">1</span>
<a href="I want this text?page=2" class="pagination_page">2</a>
<a href=""I want this text?page=3" class="pagination_page">3</a>
<a href=""I want this text?page=4" class="pagination_page">4</a>
<a href=""I want this text?page=5" class="pagination_page">5</a>
<a href=""I want this text?page=6" class="pagination_last">6</a>
<a href=""I want this text?page=2" class="pagination_next">Next »</a> //<--- this one
</div>
</div>
</section>
Я пробовал что-то вроде этого: r.xpath('//*[@class="thread-navigation" and contains (., "Next")]').get()
Но он всегда возвращает None
Спасибо