bruh

Home   »   bruh

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from time import sleep

#
url = 'https://github.com'
username = "bruh"
password= "bruh"

# Initiate a chrome browser instance (provided by the ChromeDriverManager)
browser = webdriver.Chrome(ChromeDriverManager().install())

# Open website
browser.get(url)


try:
  login_page = browser.find_element_by_xpath("//*[@href='/login']")
  login_page.click()

  # Get username & password inputs
  username_input = browser.find_element_by_id('login_field')
  password_input = browser.find_element_by_id('password')
  btn = browser.find_element_by_name('commit')

  # Input username & password
  username_input.send_keys(username)
  password_input.send_keys(password)

  # Click the login button
  btn.click()

  # Always sleep between requests ahembak
  sleep(100)

except Exception as e:
  print(e)
finally:
  browser.close()

Leave a Reply

Your email address will not be published. Required fields are marked *