From 0600d74a8aea8b459ceedebdfe7216fbc95ecdfa Mon Sep 17 00:00:00 2001 From: Avdhesh-Varshney <114330097+Avdhesh-Varshney@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:30:51 +0530 Subject: [PATCH] =?UTF-8?q?Auto=20LinkedIn=20=F0=9F=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Auto-Linkedin/Auto-LinkedIn.py | 26 ++++++++++++++++++++++++++ Auto-Linkedin/README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Auto-Linkedin/Auto-LinkedIn.py create mode 100644 Auto-Linkedin/README.md diff --git a/Auto-Linkedin/Auto-LinkedIn.py b/Auto-Linkedin/Auto-LinkedIn.py new file mode 100644 index 0000000000..84a7f49996 --- /dev/null +++ b/Auto-Linkedin/Auto-LinkedIn.py @@ -0,0 +1,26 @@ +from selenium import webdriver #connect python with webbrowser-chrome +from selenium.webdriver.common.keys import Keys +import pyautogui as pag + +def main(): + url = "http://linkedin.com/" #url of LinkedIn + network_url = "http://linkedin.com/mynetwork/" # url of LinkedIn network page + driver = webdriver.Chrome('F:\Argha\WebDriver\chromedriver.exe') # path to browser web driver + driver.get(url) + +def login(): + username = driver.find_element_by_id("login-email") # Getting the login element + username.send_keys("username") # Sending the keys for username + password = driver.find_element_by_id("login-password") # Getting the password element + password.send_keys("password") # Sending the keys for password + driver.find_element_by_id("login-submit").click() # Getting the tag for submit button + +def goto_network(): + driver.find_element_by_id("mynetwork-tab-icon").click() + +def send_requests(): + n= input("Number of requsts: ") # Number of requests you want to send + for i in range(0,n): + pag.click(880,770) # position(in px) of connection button + print("Done!") + diff --git a/Auto-Linkedin/README.md b/Auto-Linkedin/README.md new file mode 100644 index 0000000000..586a002b08 --- /dev/null +++ b/Auto-Linkedin/README.md @@ -0,0 +1,26 @@ +## Auto Linkedin + +- It imports the necessary modules: + - webdriver from Selenium to control the web browser, + - Keys from Selenium to handle keyboard keys, and pyautogui as pag to simulate mouse clicks. + +- The main() function sets up the Selenium WebDriver with the Chrome browser and opens the LinkedIn website. + +- The login() function finds the login elements on the LinkedIn page and enters the provided username and password. + +- It also clicks the submit button to log in. + +- The goto_network() function clicks on the "My Network" tab on the LinkedIn page. + +- The send_requests() function prompts the user to enter the number of connection requests they want to send. + +- It then uses the PyAutoGUI library to simulate mouse clicks on the connection button (at the specified position) the specified number of times. + +- Install this before running : + 1. pip install selenium + 2. pip install pyautogui + +Once you have installed the necessary libraries and downloaded the Chrome WebDriver, you should be able to run the code successfully. + +**Thanks for using this program** +