Image what i want to download.
Image is of LinkedIn profile page of my friend i want to click on that save-as-pdf option for many users.
can that be downloaded using python code? for different users? or can it be downloaded using any other language?
Image what i want to download.
Image is of LinkedIn profile page of my friend i want to click on that save-as-pdf option for many users.
can that be downloaded using python code? for different users? or can it be downloaded using any other language?
Yes you can automate this with python that works for every profile, so you dont have to worry about ids changing
import time
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChainslogin = "Email address goes here"
password = "Type your password here"#start browser session
chromedriver = "/home/romtein/chromedriver" #change this to your selenium driver
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)#open linkedin in automated browser
driver.get("https://www.linkedin.com/")
time.sleep(1)#logs you into Linkedin
driver.find_element_by_id("login-email").send_keys(str(login))
password = driver.find_element_by_id("login-password").send_keys(str(password))
driver.find_element_by_id("login-submit").click()
print("successfully logged in")#navigates to your connections
time.sleep(1)
driver.get("https://www.linkedin.com/mynetwork/invite-connect/connections/")
time.sleep(1)#opens a new tab of your top contact
ActionChains(driver).key_down(Keys.CONTROL).send_keys('t').perform()
contact_page_open = driver.find_element_by_class_name("mn-connection-card__name").click()
time.sleep(2)#switch to new tab
driver.switch_to_window(driver.window_handles[1])
time.sleep(1)
# ActionChains(driver).key_up(Keys.CONTROL).perform()#click the "more" button
driver.find_element_by_class_name("pv-s-profile-actions__overflow").click()
time.sleep(1)#saves profile to pdf
driver.find_element_by_class_name("pv-s-profile-actions pv-s-profile-actions--save-to-pdf").click()
time.sleep(1)
Let me know if you have any questions