Last active
August 20, 2022 10:42
-
-
Save yasircs4/7267ee87395953f8a91e6a6f60231790 to your computer and use it in GitHub Desktop.
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
// 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