Skip to content

Instantly share code, notes, and snippets.

@MichaelLawton
Last active November 10, 2024 20:36
Show Gist options
  • Save MichaelLawton/ec73c321d62d1b4eaf0f51ca478ccd92 to your computer and use it in GitHub Desktop.
Save MichaelLawton/ec73c321d62d1b4eaf0f51ca478ccd92 to your computer and use it in GitHub Desktop.
Removes all Amazon saved for later 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.
function deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]")
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
}
}
deleteSavedItems();
@mittingphx
Copy link

Looks like others also added similar checks to restart the script automatically when you get the quota limit errors. Here's a link to the version that I wrote last night which worked well the first time without any further intervention (super fun to watch the count go down in real time). Fingers cross it continues to work, works great in Oct 2024. https://github.com/mittingphx/WebsiteAutomation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment