-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
27 lines (21 loc) · 863 Bytes
/
script.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
#!/usr/bin/python
import sys
import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=chrome_options, executable_path='chromedriver')
username = sys.argv[1]
password = sys.argv[2]
def renew():
driver.get ('https://www.skelbiu.lt/users/renew')
driver.find_element_by_id('nick').send_keys(username)
driver.find_element_by_id('password').send_keys(password)
driver.find_element_by_id('login-button').click()
driver.implicitly_wait(1)
driver.find_element_by_xpath('//*[@id="default_page_content"]/form/button').click()
renew()