[Python] Bulk delete old Linkedin posts in year 2019 using python

Discussão em 'Python' iniciado por Stack, Junho 26, 2025.

  1. Stack

    Stack Membro Participativo

    I wanted to bulk delete old posts on LinkedIn. When I approached the company itself (LinkedIn), they said they only have the functionality to delete one post at a time, which highlights the limitations of their social media platform.

    # Import necessary libraries
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.chrome.options import Options
    from bs4 import BeautifulSoup as bs
    import time
    import pandas as pd
    import re
    from datetime import datetime
    from dateutil.relativedelta import relativedelta

    # Initialize Chrome options
    chrome_options = Options()
    # today = datetime.today().strftime('%Y-%m-%d')More actions
    start = datetime.datetime.strptime("01-01-2022", "%d-%m-%Y")
    end = datetime.datetime.strptime("31-12-2022", "%d-%m-%Y")

    #LinkedIn Credentials
    username=""
    password=""

    # Set LinkedIn page URL for deleting
    page = 'https://www.linkedin.com/login username/'

    # Initialize WebDriver for Chrome
    browser = webdriver.Chrome()

    # Open LinkedIn login page
    browser.get('https://www.linkedin.com/login')

    # Enter login credentials and submit
    elementID = browser.find_element(By.ID, "username")
    elementID.send_keys(username)
    elementID = browser.find_element(By.ID, "password")
    elementID.send_keys(password)
    elementID.submit()

    # Navigate to the posts page of the user
    post_page = page + '/posts'



    I'm unsure what should be done next to bulk delete all posts from 2022... Ideas and help are most welcome.

    Continue reading...

Compartilhe esta Página