title: Nokogiri returns "no method error"
body: <p>I keep getting the same error in my program. I've written a method that takes some messy HTML and turns it into neater strings. This works fine on its own, however when I run the whole program I get the following error:</p>
  
  <pre><code>kamer.rb:9:in `normalise_instrumentation': undefined method `split' for #&lt;Nokogiri::XML::NodeSet:0x007f92cb93bfb0&gt; (NoMethodError)
  </code></pre>
  
  <p>I'd be really grateful for any info or advice on why this happens and how to stop it. </p>
  
  <p>The code is here:</p>
  
  <pre><code>require 'nokogiri'
  require 'open-uri'
  
  def normalise_instrumentation(instrumentation)
      messy_array = instrumentation.split('.')
      normal_array = []
      messy_array.each do |section|
           if section =~ /\A\d+\z/
              normal_array &lt;&lt; section
          end
  end
  return normal_array
  end
  
  doc = Nokogiri::HTML(open('http://www.cs.vu.nl/~rutger/vuko/nl/lijst_van_ooit/complete-solo.html'))
  table = doc.css('table[summary=works] tr')
  
  work_value = []
  work_hash = {}
  
  table.each do |row|
      piece = [row.css('td[1]'), row.css('td[2]'), row.css('td[3]')].map { |r|
          r.text.strip!
      }
      work_value = work_value.push(piece)
      work_key = normalise_instrumentation(row.css('td[3]'))
      work_hash[work_key] = work_value
  end
  
  puts work_hash
  </code></pre>