Skip to content

Instantly share code, notes, and snippets.

@bigansh
Last active May 28, 2024 07:10
Show Gist options
  • Save bigansh/8a2ea9e556257f8ff245615a530edf24 to your computer and use it in GitHub Desktop.
Save bigansh/8a2ea9e556257f8ff245615a530edf24 to your computer and use it in GitHub Desktop.
Remove Flipkart's wishlist all at once.
// So, I saw a Gist on GitHub for removing wishlist for Amazon using browser's console but couldn't find it for Flipkart, so I thought I would do it for myself, and it worked, so I am sharing the same with you. Hope it helps.
// Copy the code as is and paste it in console using CTRL + SHIFT + J.
// Note: It will only remove what is visible, so you may have to use it multiple times.
function deleteSavedItems() {
let query = document.getElementsByClassName("_2Nq6Qc")
timeout(query)
query = document.getElementsByClassName("_2KpZ6l _3S58wp")
timeout(query)
}
function timeout(query) {
if (query.length) query[0].click()
if (query.length > 1) setTimeout(deleteSavedItems, 100)
else console.log('Finished')
}
deleteSavedItems()
@AabhashGauda
Copy link

try the below code out i just added the reload thing it will reload the page after the completion so that again and again loadmore button is not clicked to show the more items of wishlist ,just paste as the window loads.... hope you update it . Thanks

function reloadThis(){window.location.reload(true)} function deleteSavedItems() {
let query = document.getElementsByClassName("_2Nq6Qc")
timeout(query)

query = document.getElementsByClassName("_2KpZ6l _3S58wp")
timeout(query)

}

function timeout(query) {
if (query.length) query[0].click()

if (query.length > 1) setTimeout(deleteSavedItems, 100)

else console.log('Finished'); reloadThis()

}

deleteSavedItems();

@Samiddha99
Copy link

The code does not work anymore.

Try this updated code:

function deleteSavedItem(element){
    element.click();
    btn = document.getElementsByClassName('QqFHMw AyekA8');
    btn[0].click();
}

function deleteSavedItems(){
    items = document.getElementsByClassName('Mj62aK');
    for(i=0; i<items.length; i++){
        deleteSavedItem(items[i]);
    }
}

deleteSavedItems();

@bigansh
Copy link
Author

bigansh commented May 28, 2024

thanks for keeping it all upto date. appreciate it, guys!

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