require 'RestClient' require 'nokogiri' def getPrice(productId) res = RestClient.get "https://www.digitec.ch/de/s1/product/#{productId}" doc = Nokogiri::HTML(res.to_s) doc.css("#product_reviewed > article .product-price").first.xpath('text()').text.strip.gsub("\u2013", "0").to_f end productId = '5721031' puts "Preis #{productId}: #{getPrice(productId)} Fr."