This should be easy but I'm stuck.
<div class="paginationControl">
<a href="/en/overview/0-All_manufactures/0-All_models.html?page=2&powerunit=2">Link Text 2</a> |
<a href="/en/overview/0-All_manufactures/0-All_models.html?page=3&powerunit=2">Link Text 3</a> |
<a href="/en/overview/0-All_manufactures/0-All_models.html?page=4&powerunit=2">Link Text 4</a> |
<a href="/en/overview/0-All_manufactures/0-All_models.html?page=5&powerunit=2">Link Text 5</a> |
<!-- Next page link -->
<a href="/en/overview/0-All_manufactures/0-All_models.html?page=2&powerunit=2">Link Text Next ></a>
</div>
I'm trying to use Scrapy (Basespider) to select a link based on it's Link text using:
nextPage = HtmlXPathSelector(response).select("//div[@class='paginationControl']/a/@href").re("(.+)*?Next")
For example, I want to select the next page link based on the fact that it's text is "Link Text Next". Any ideas?