-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.py
63 lines (62 loc) · 1.65 KB
/
core.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
def click(id):
try:
search = browser.find_element_by_id(id)
search.click()
except: print("error : " + id)
browser = webdriver.Firefox()
browser.get("https://www.projet-voltaire.fr/")
def click_class(classeur):
try:
search = browser.find_element_by_class_name(classeur)
search.click()
except: print("error : " + classeur)
try:
search = browser.find_element_by_id("service-message-close-btn")
search.click()
sleep(2)
except: print("Fail maintenance log")
click("authenticateOption")
username = input("Please enter your username >>> ")
psw = input("Please enter your password >>> ")
browser.find_element_by_id("login-username").send_keys(username)
browser.find_element_by_id("login-pwd").send_keys(psw)
input("Appuyez quand vous avez réalisé le captcha ...")
try:
click("topAuthenticationSubmit")
except: pass
print("Waiting for connection ...")
sleep(15)
print(browser.current_url)
click("applicationOrthographe")
click("btn_home_module_lancer_" + input("Niveau à lancer >>> "))
print("Waiting ...")
sleep(60)
n = browser.current_url
while True:
click('btn_question_suivante')
n = browser.current_url
sleep(.5)
click_class('nextButton')
n = browser.current_url
sleep(.5)
click_class('understoodButton')
n = browser.current_url
sleep(.5)
click_class('buttonKo')
n = browser.current_url
sleep(.5)
click_class('buttonOk')
n = browser.current_url
sleep(.5)
click_class('buttonKo')
n = browser.current_url
sleep(.5)
click_class('exitButton secondaryButton')
n = browser.current_url
sleep(.5)
click_class('popupButton')
n =browser.current_url
sleep(.5)