Fixed JPY price crawl

This commit is contained in:
Felipe Martín 2015-06-24 08:59:57 +02:00
parent 4e4bfa17ee
commit f72b681ac2
1 changed files with 11 additions and 2 deletions

View File

@ -32,10 +32,19 @@ class AmazonBaseCrawler(object):
products = self.amazon.lookup(ItemId=','.join(chunk_product_ids))
for product in products:
price_and_currency = product.price_and_currency
price = price_and_currency[0]
currency = price_and_currency[1]
if currency == 'JPY':
price = float(price)*100
print(self.region, product.asin, price, currency)
result.append({
'shop_product_id': product.asin,
'price': price_and_currency[0].replace(',', ''),
'currency': price_and_currency[1],
'price': price,
'currency': currency,
})
sleep(1)