Skip to content

Instantly share code, notes, and snippets.

@ceres-c
Last active June 10, 2025 09:48
Show Gist options
  • Save ceres-c/392651ddcc324184826f2fbee6dcbc67 to your computer and use it in GitHub Desktop.
Save ceres-c/392651ddcc324184826f2fbee6dcbc67 to your computer and use it in GitHub Desktop.
IKEA shopping cart exporter
/* 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 priceTotal_text = itemDiv.querySelector("[class*='cart-ingka-price'] [class='notranslate']").textContent;
let priceTotal = priceTotal_text.split(" ").slice(-1)[0];
let pricePerItem;
let pricePerItem_div = itemDiv.querySelector("[class*='_pricePerItem'] [class='notranslate']")
if (pricePerItem_div) {
let pricePerItem_text = pricePerItem_div.textContent;
pricePerItem = pricePerItem_text.split(" ").slice(-1)[0];
} else {
pricePerItem = priceTotal;
}
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