Code:Wie teilt man ein Array von Zellen in Ruby?
doc = Nokogiri::HTML(html)
showings = []
doc.css('.ok-product').each do |showing|
showing_id = showing['data-cart-id'].to_i
price = showing.at_css('.ok-product__price-main').text.gsub(/[\u0440\u0443\u0431.]/, '').strip
showings.push(
id: showing_id,
price: price
)
end
CSV.open("file.csv", "wb") do |csv|
csv << showings
end
bekomme ich die Daten in csv in Zelle A1:
{:id=>26999, :price=>"395,00"},"{:id=>26963, :price=>""254,00""}"...
die Daten in Zellen Pause braucht und unnötigen Symbole entfernen.
Wie nennt man Zellen? – yoones
Jetzt alles in A1. Aber ich brauche: A1, B1, A2, B2, A3, B3 ... – Mamom
Bitte lesen Sie "[mcve]". Wir benötigen die minimalen Eingabedaten, die notwendig sind, um das Problem zu demonstrieren. Was ist 'html'? Ohne das macht deine Frage keinen Sinn. –