forked from minugavand/Project-Initialization-Automation
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove.py
26 lines (20 loc) · 1008 Bytes
/
remove.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
import sys
from selenium import webdriver
username = sys.argv[1]
password = sys.argv[2]
reponame = sys.argv[3]
browser = webdriver.Chrome()
browser.get('http://github.com/login')
def remove():
browser.find_elements_by_xpath("//input[@name='login']")[0].send_keys(username)
browser.find_elements_by_xpath("//input[@name='password']")[0].send_keys(password)
browser.find_elements_by_xpath("//input[@name='commit']")[0].click()
browser.get('https://github.com/silv4b/' + reponame + '/settings')
browser.find_elements_by_xpath('//*[@id="options_bucket"]/div[9]/ul/li[4]/details/summary')[0].click()
browser.find_elements_by_xpath(
'//*[@id="options_bucket"]/div[9]/ul/li[4]/details/details-dialog/div[3]/form/p/input')[0].send_keys(reponame)
browser.find_elements_by_xpath(
'//*[@id="options_bucket"]/div[9]/ul/li[4]/details/details-dialog/div[3]/form/button')[0].click()
browser.get("https://github.com/" + username)
if __name__ == "__main__":
remove()