Hi Guys,

new to RoR but I've been stuck on this problem for a few days now. So goal 
is to scrape this data 
-- 
http://lol.esportspedia.com/wiki/Riot_League_Championship_Series/North_America/2015_Season/Summer_Season/Picks_and_Bans
 
- and then organize it in the following format

   - the teams involved (top left, top right columns)
   - the match result (1,0)
   - the bans --> relational to the team
   - the picks --> relational to the team
      - the pick sequence
         - goes from 1-10, left picks 1st, right picks 2nd,3rd, left picks 
         4th n 5th (pattern goes to 10)
      
currently using the Nokogiri gem and was able to scrape the data with the 
following code (saved the html and parsed it locally) 

require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'csv'

f = File.open("napb.html")

doc = Nokogiri::XML(open(f))
CSV.open("file21.csv", "wb") do |data|               
  doc.css('table.prettytable > *').search('tr').each do |tr|
    data << tr.search('td').map(&:text)
    
  end 
end 
 
I've been trying many different ways to put the data into arrays but I 
haven't had much success. Anyone can point me in the right direction?

Thanks a bunch
Aries

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/8b1ac226-e1e2-4f36-a3d2-26bd518355ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to