-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02.GitHub.py
32 lines (20 loc) · 866 Bytes
/
02.GitHub.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from githubUserInfo import username, password
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
class Github:
def __init__(self,username,password):
self.browser = webdriver.Chrome()
self.username = username
self.password = password
self.followers = []
def signIn(self):
self.browser.get("https://github.com/login")
time.sleep(2)
self.browser.find_element(By.XPATH, "//*[@id='login_field']" ).send_keys(self.username)
self.browser.find_element(By.XPATH, "//*[@id='password']").send_keys(self.password)
time.sleep(2)
self.browser.find_element(By.NAME, "commit").click()
time.sleep(3)
github = Github(username, password)
github.signIn()