I need to parse this page https://www.petsonic.com/snacks-huesos-para-perros/ and recieve information from every item(name,price,image,etc.). The problem is that i don't know how to parse array of URL. If i were using 'open-uri' i would do something like this
require 'nokogiri'
require 'open-uri'
page="https://www.petsonic.com/snacks-huesos-para-perros/"
doc=Nokogiri::HTML(open(page))
links=doc.xpath('//a[@class="product-name"]/@href')
links.to_a.each do|url|
doc2=Nokogiri::HTML(open(url))
text=doc2.xpath('//a[@class="product-name"]').text
puts text
end
However, i am only allowed to use 'Curb' and that's making me confused