Issue
I'm trying to get only a tag which contains "next" and this is what I applied
response.xpath('//a[text()="next"]')
But it's returning empty. Here is the details: Please tell me what's wrong I'm doing?
<div class="pagination">
<a href="/lists?page=2">2</a>
<a href="/lists?page=3">3</a>
<a href="/lists?page=4">4</a>
<a href="/lists?page=5">5</a>
<a href="/lists?page=6">6</a>
<a href="/lists?page=7">7</a>
<a href="/lists?page=8">8</a>
<a href="/lists?page=9">9</a>...
<a href="/lists?page=510">510</a>
<a href="/lists?page=511">511</a>
<a href="/lists?page=2">next <i class="fa-angle-double-right" aria-hidden="true"></i></a></div>
Solution
try this
response.xpath('//a[contains(text(), "next")]/@href')
Answered By - just don't be user123
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.