require 'mechanize' agent = Mechanize.new page = agent.get('http://pripara.jp/item/collection.html') page.search('div.localNav li a').each do |category| p category[:href] end