Skip to content

Instantly share code, notes, and snippets.

@evantancy
Last active August 31, 2024 11:21
Show Gist options
  • Save evantancy/8c22dcebb97acd7525825554e2310583 to your computer and use it in GitHub Desktop.
Save evantancy/8c22dcebb97acd7525825554e2310583 to your computer and use it in GitHub Desktop.
Easy way to remove saved jobs on LinkedIn
[...document.querySelectorAll('button.invitation-card__action-btn')].forEach(b => {
if (b.innerText === 'Accept') {
b.click()
}
})
// Open Chrome. Not tested on other browsers but should work ¯\_(ツ)_/¯.
// Go to https://www.linkedin.com/my-items/saved-jobs/
// Make sure Saved and not Applied is selected.
// Open the Chrome Dev Tools by hitting F12 on your keyboard.
// Go to Console tab.
// Paste this script in the space bellow after the little > symbol.
// Hit Enter.
// The jobs will start to be deleted 1 by 1 after a 5 sec pause.
// Leave the window open but you can do something else while it does it's thing.
// If it gets tripped up just start over.
// Close or refresh the tab to stop it.
setInterval(function(){
//click on the 3 dots drop down menu
document.getElementsByClassName('artdeco-button--tertiary')[1].click()
var third = document.getElementsByClassName('image-text-lockup__text')[2]
var fourth = document.getElementsByClassName('image-text-lockup__text')[3]
if(third.textContent.includes("Unsave")){
//Job no longer taking applications need to click third item on drop down list
third.click()
}else{
//Job still hiring need to click fourth item on drop down list
fourth.click()
}
//Dismiss the item unsaved popup after waiting 1 second for it to appear.
setTimeout(function(){
document.getElementsByClassName('artdeco-toast-item__dismiss')[0].click()
},1000);
},2500);
// Wait 5 seconds between deleting items, seems to work well to give the list enough time to reload after a delete.
@vsinghviews
Copy link

Hey mate, I am new to programming and just recently learnt Python. I tried creatin something similar myself with what I have learnt and with th help of Ai. However, the issue I keep coming across is being unable to find the unsave button as it's nested quite deep. Would you be able to assist?
Code:

for jobs in job_elements:
    print("clicking 3 dot button")
    ddbutton = browser.find_element(By.CLASS_NAME, 'button.artdeco-button')
    ddbutton.click()
    time.sleep(10)
    print("clicking unsave button")
    ddbutton_items = browser.find_element(By.CLASS_NAME, 'button.artdeco-dropdown__item')

    if len(ddbutton_items) > 3:
        if "Unsave" in ddbutton_items[4].text:
            ddbutton_items.click()
            print("Clicked the second option")
    else:
        ddbutton_items[3].click()
        print("Clicked the third option")
    time.sleep(5)

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