Last active
April 10, 2025 09:19
-
-
Save ceres-c/392651ddcc324184826f2fbee6dcbc67 to your computer and use it in GitHub Desktop.
IKEA shopping cart exporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This will output in your console a pipe-separated list of items formatted as | |
* itemID|itemName|itemNumber|pricePerItem|priceTotal | |
* Updated: 2025-04-09 | |
* Ikea locale: IT | |
*/ | |
for (let itemDiv of document.querySelectorAll("div[itemscope")) { | |
let itemID = itemDiv.querySelector("[class='cart-ingka-product-identifier__value']").textContent; | |
let itemName = itemDiv.querySelector("[class*='name-decorator']").textContent | |
let itemNumber = itemDiv.querySelector("[class='cart-ingka-quantity-stepper__input']").value; | |
let pricePerItem_text = itemDiv.querySelector("[class*='_pricePerItem'] [class='notranslate']").textContent; | |
let pricePerItem = pricePerItem_text.split(" ").slice(-1)[0]; | |
let priceTotal_text = itemDiv.querySelector("[class*='cart-ingka-price'] [class='notranslate']").textContent; | |
let priceTotal = priceTotal_text.split(" ").slice(-1)[0]; | |
console.log(`${itemID}|${itemName}|${itemNumber}|${pricePerItem}|${priceTotal}`) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment