I have been using nokogiri css for a while and i would like to be able to use ruby expression interpolation inside css selectors but it doesn't work. This is the code i would like to use:
doc = Nokogiri::HTML(open('http://www.somepage.com'))
keys=["BHiuG", "hUYtb4F", "jefHUY78i"]
keys.each do |k|
keyvalue = doc.css('span[class="#{k}"]').children
puts keyvalue
end
Is there any way to get a similar syntax working?