Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'open-uri'
- require 'nokogiri'
- url = 'http://www.petsonic.com/es/perros/snacks-y-huesos-perro/galletas-granja-para-perro'
- html = open(url)
- doc = Nokogiri::HTML(html)
- names = []
- doc.xpath('//div[@class = "attribute_list"]/*' ).each do |row|
- tempName = row.at_xpath('//span[@class = "attribute_name"]')
- tempPrice = row.at_xpath('//span[@class = "attribute_price"]')
- puts tempName
- puts tempPrice
- end
- //span[@class = "attribute_name"]
- //span[@class = "attribute_price"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement