74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/amazomania/parse_html.rb', line 74
def shipping_prices
nodesets = @nokogiried_doc.xpath("//span[@class='a-color-secondary']")
shipping_prices = []
nodesets.each do |nodeset|
if nodeset.to_s.include?("color: #990000;")
next
end
if nodeset.to_s.include?("olpShippingPrice")
shipping_price = nodeset.inner_text.chomp.gsub(" ", "").gsub(/(\r\n|\r|\n|\f)/,"")
shipping_price = shipping_price.gsub(/[^\d]/, "")
shipping_prices.push(shipping_price)
else
shipping_prices.push("0")
end
end
shipping_prices
end
|