I am having a few problems adding to an array from within a loop. It only adds the last results to the array and loses the previous 9 sets.
I think I have to create a new array inside of the loop and then add the new one to the previous. I'm just not sure how I go about doing that.
array = Array.new
10.times do
array2 = Array.new
pagenum = 0
results = Nokogiri::HTML(open("#{url}#{pagenum}"))
results.css("div").each do |div|
array.push div.inner_text
end
pagenum + 10
array.concat(array2)
end