Skip to content

Instantly share code, notes, and snippets.

@Stormix
Created May 4, 2021 23:30
Show Gist options
  • Save Stormix/f77c1b99a297987ccfda470ebc81a544 to your computer and use it in GitHub Desktop.
Save Stormix/f77c1b99a297987ccfda470ebc81a544 to your computer and use it in GitHub Desktop.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment