Created
May 19, 2022 11:44
-
-
Save harendra21/e4a3d1137cdb020d512aae4d8d917a1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment