-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote.py
28 lines (24 loc) · 978 Bytes
/
remote.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
import sys
import os
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
browser = webdriver.Chrome(ChromeDriverManager().install())
browser.get('http://github.com/login')
username = ''
password = ''
def create():
folderName = str(sys.argv[1])
python_button = browser.find_elements_by_xpath("//input[@name='login']")[0]
python_button.send_keys(username)
python_button = browser.find_elements_by_xpath("//input[@name='password']")[0]
python_button.send_keys(password)
python_button = browser.find_elements_by_xpath("//input[@name='commit']")[0]
python_button.click()
browser.get('https://github.com/new')
python_button = browser.find_elements_by_xpath("//input[@name='repository[name]']")[0]
python_button.send_keys(folderName)
python_button = browser.find_element_by_css_selector('button.first-in-line')
python_button.submit()
browser.quit()
if __name__ == "__main__":
create()