How should I do a loop a nokogiri search in ruby?
- by kim
I have the following that I retreive the title of each url from an array that contains a list of urls.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
@urls = ["http://google.com", "http://yahoo.com", "http://rubyonrails.org"]
@found_titles = Array.new
@found_titles[0] = Nokogiri::HTML(open("#{@urls[0]}")).search("title").inner_html
…