Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arbal/1d20cdfc0a74a55176c6da0c03e14474 to your computer and use it in GitHub Desktop.
Save arbal/1d20cdfc0a74a55176c6da0c03e14474 to your computer and use it in GitHub Desktop.
Moves all Amazon saved for later items on the cart page to a private Wish List named "Saved For Later". It will only moves 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 moveSavedItemsToWishList() {
var query = document.querySelectorAll("#sc-saved-cart input[value='Move to Wish List']")
if (query.length) {
query[0].click();
console.log("after move item click")
var wl = document.querySelectorAll("a[aria-label='Saved For Later (Private,item)']");
if (wl.length) {
wl[0].click();
}
console.log("after wishlist click")
}
if (query.length > 1) {
setTimeout(moveSavedItemsToWishList,5000);
}
else {
console.log('Finished');
}
}
moveSavedItemsToWishList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment