Created
October 8, 2021 23:48
-
-
Save vlussenburg/f92a983c13884302a919a0dd905e3a0c to your computer and use it in GitHub Desktop.
JavaScript snippet to empty out your Whole Foods cart on Amazon
This file contains 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
function deleteWholeFoodsCart() { | |
var query = document.querySelectorAll("#sc-expanded-cart-localmarket input[value='Delete']") | |
if (query.length) { | |
query[0].click(); | |
} | |
if (query.length > 1) { | |
setTimeout(deleteWholeFoodsCart, 500); | |
} | |
else { | |
console.log('Finished'); | |
} | |
} | |
deleteWholeFoodsCart(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment