Last active
January 25, 2024 20:41
-
-
Save dzg/0cfe22c496355f20ab6ff24dd00848f3 to your computer and use it in GitHub Desktop.
"Saves for later" all Amazon cart items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
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 saveAllItemsForLater() { | |
var query = document.querySelectorAll("input[data-action='save-for-later']"); | |
var last = query[query.length-1] | |
if (query.length) { last.click(); } | |
if (query.length > 1) { setTimeout(saveAllItemsForLater, 100); } | |
else { console.log('Finished'); } | |
} | |
saveAllItemsForLater(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adapted from https://gist.github.com/MichaelLawton/ec73c321d62d1b4eaf0f51ca478ccd92