Skip to content

Instantly share code, notes, and snippets.

@ceres-c
Last active April 10, 2025 09:19
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 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