🐛 FIX: rightPrice est convertit en Number

This commit is contained in:
Divlo 2020-04-28 18:06:12 +02:00
parent fbe225fbbb
commit df512dea12

View File

@ -27,10 +27,11 @@ async function getAmazonProductList(url) {
try {
const elementProduct = amazonProductList[indexProduct];
const productImage = elementProduct.querySelector('.s-image');
const originalPrice = elementProduct.querySelector(".a-price-whole").innerHTML;
productsList.push({
name: productImage["alt"],
image: productImage["src"],
price: elementProduct.querySelector(".a-price-whole").innerHTML
price: Number(originalPrice.replace(",", ".").replace(" ", ""))
});
} catch (error) {
continue;