-
Notifications
You must be signed in to change notification settings - Fork 8
/
auternos.py
47 lines (35 loc) · 1.15 KB
/
auternos.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from selenium import webdriver
import time
import sys
import os
driver = webdriver.Chrome('/path/to/bin/chromedriver')
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--test-type")
options.binary_location = "/path/to/bin/chromium"
driver = webdriver.Chrome(options=options)
driver.get('https://aternos.org/servers/')
# log in
text_area = driver.find_element_by_id('user')
text_area.send_keys("username")
text_area = driver.find_element_by_id('password')
text_area.send_keys("password")
login = driver.find_element_by_xpath('/html/body/div[3]/div/div/div[4]/div[3]/div[4]')
login.click()
time.sleep(3)
# select server
select = driver.find_element_by_xpath('/html/body/div/main/section/div/div[2]/div/div[1]')
select.click()
# wait for the page to load
time.sleep(5)
# click start button
start = driver.find_element_by_xpath('/html/body/div[2]/main/section/div[3]/div[4]/div[1]')
start.click()
time.sleep(5)
# click cancel
cancel = driver.find_element_by_xpath('/html/body/div[2]/main/div/div/div/main/div/a[2]')
cancel.click()
time.sleep(3)
#close chromium and python
os.system("killall chromium")
sys.exit()