Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yasircs4/7267ee87395953f8a91e6a6f60231790 to your computer and use it in GitHub Desktop.
Save yasircs4/7267ee87395953f8a91e6a6f60231790 to your computer and use it in GitHub Desktop.
// open this url with your account open: https://www.flipkart.com/account/orders?link=home_orders
// then copy pasta this code in your console
const items = document.getElementsByClassName('_1_SN5_');
const totolOrders = Array.from(items).reduce((accumulator, currentValue) => {
const price = parseInt(currentValue.innerText.replace('₹', '') );
if(isNaN(price)) return accumulator; // avoid free order
return accumulator + price;
}, 0);
console.log({totolOrders});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment