Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="paginate_box">
- <span class="disabled prev_page">Back</span>
- <span class="current">1</span>
- <a rel="next" href="page2">2</a>
- <a rel="next" href="page3">3</a>
- <a class="next_page" rel="next" href="page2">Next</a>
- </div>
- doc = Nokogiri::HTML(html)
- doc.xpath('//div[@class="paginate_box"]/a[not(@class="next_page")]').last.text
- #=> "3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement