🐛 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

@ -26,11 +26,12 @@ async function getAmazonProductList(url) {
for (let indexProduct in amazonProductList) {
try {
const elementProduct = amazonProductList[indexProduct];
const productImage = elementProduct.querySelector('.s-image');
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;