Rubyでスクレイピングを学ぶ。特定のページにあるアウトバウンドリンクの数をカウントしようとしていますが、アウトバウンドリンクのみをカウントするようにRubyに指示する方法がわかりません。
私の現在のコード:
require "open-uri"
# Collect info
puts "What is your URL?"
url = gets.chomp
puts "Your URL is #{url}"
puts "Loading..."
# Check keyword count
page = open(url).read
link_total = page.scan("</a>")
# obl_count = ???
link_count = link_total.count
puts "Your site has a total of #{link_count} links."
どうすればこれを完了できますか?