我有以下html,其中有几个重复的href。如何仅提取唯一链接
<div class="pages">
<a href="/search_results.aspx?f=Technology&Page=1" class="active">1</a>
<a href="/search_results.aspx?f=Technology&Page=2">2</a>
<a href="/search_results.aspx?f=Technology&Page=3">3</a>
<a href="/search_results.aspx?f=Technology&Page=4">4</a>
<a href="/search_results.aspx?f=Technology&Page=5">5</a>
<a href="/search_results.aspx?f=Technology&Page=2">next ›</a>
<a href="/search_results.aspx?f=Technology&Page=6">last »</a>
</div>
# p => is the page that has this html
# The below gives 7 as expected. But I don't need next/last links as they are duplicate
p.css(".pages a").count
#So I tried uniq which obviously didnt work
p.css(".pages").css("a").uniq #=> didn't work
p.css(".pages").css("a").to_a.uniq #=> didn't work