In this regex on line 5 everything between the parentheses will be returned 
as the match array? Right now it fails with TypeError: no implicit 
conversion of nil into String


doc=Nokogiri::HTML.parse(file)
doc.css("script").each do |s|
if s.text=~/skuProducts/
js_string = s.text
data = js_string[/\[,(.+?)\]/, 1]
parsed_data = JSON.parse(data)
end 
end

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/ba226e4c-b2b0-4e12-b6a4-1e8dcebe2c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to