Nokogiri を使用して、テキストで検索して Web ページから特定のリンクを抽出したい:
<div class="links">
<a href='http://example.org/site/1/'>site 1</a>
<a href='http://example.org/site/2/'>site 2</a>
<a href='http://example.org/site/3/'>site 3</a>
</div>
「サイト 3」の href が必要で、以下を返します。
http://example.org/site/3/
または、「サイト 1」の href が必要で、次のように返します。
http://example.org/site/1/
どうすればいいですか?