@@ -68,6 +68,7 @@ def report(user_index):
68
68
print ('[Info] Jumping to HSM page' )
69
69
browser .get ('https://hsm.sspu.edu.cn/selfreport/Default.aspx' )
70
70
time .sleep (0.5 )
71
+
71
72
print ('[Info] Jumping to Daily Report page' )
72
73
browser .get ('https://hsm.sspu.edu.cn/selfreport/DayReport.aspx' )
73
74
time .sleep (1 )
@@ -80,11 +81,11 @@ def report(user_index):
80
81
loc = int ((min_value + max_value ) / 2 )
81
82
scale = max_value - loc
82
83
temperature = int (normal (loc = loc , scale = scale )) / 10
83
-
84
84
if int (temperature * 10 ) < min_value or int (temperature * 10 ) > max_value :
85
85
temperature = randint (min_value , max_value ) / 10
86
86
87
87
print ('[Info] Auto generated temperature:' , temperature )
88
+
88
89
temperature_box = browser .find_element_by_id ('p1_TiWen-inputEl' )
89
90
temperature_box .clear ()
90
91
temperature_box .send_keys (str (temperature ))
@@ -94,7 +95,8 @@ def report(user_index):
94
95
agree_box .click ()
95
96
time .sleep (0.5 )
96
97
97
- condition_good = browser .find_element_by_id ('fineui_2-inputEl-icon' )
98
+ condition_good = browser .find_element_by_id ('p1_DangQSTZK' ) \
99
+ .find_element_by_id ('fineui_2-inputEl-icon' )
98
100
condition_good .click ()
99
101
time .sleep (0.5 )
100
102
@@ -112,23 +114,24 @@ def report(user_index):
112
114
browser .quit ()
113
115
return 1
114
116
115
- yes_button_1 = browser .find_element_by_id ('fineui_27' ) \
116
- .find_element_by_id ('fineui_30' )
117
+ yes_button_1 = browser .find_element_by_id ('fineui_34' ) \
118
+ .find_element_by_id ('fineui_36' ) \
119
+ .find_element_by_id ('fineui_37' )
117
120
yes_button_1 .click ()
118
121
time .sleep (1 )
119
122
120
123
for i in range (int (config .timeout / 3 )):
121
124
time .sleep (3 )
122
125
try :
123
- browser .find_element_by_id ('fineui_32 ' )
126
+ browser .find_element_by_id ('fineui_39 ' )
124
127
except exceptions .NoSuchElementException :
125
128
print ('[Info] Waiting: ' + str (i * 3 ) +
126
129
' / ' + str (config .timeout ) + ' seconds' )
127
130
continue
128
131
break
129
132
130
133
try :
131
- browser .find_element_by_id ('fineui_32 ' )
134
+ browser .find_element_by_id ('fineui_39 ' )
132
135
except exceptions .NoSuchElementException :
133
136
print ('[Error] Submit timeout' )
134
137
if config .users [user_index ]['use_wechat' ]:
@@ -138,9 +141,9 @@ def report(user_index):
138
141
139
142
print ('[Info] Reported successfully' )
140
143
141
- yes_button_2 = browser .find_element_by_id ('fineui_32 ' ) \
142
- .find_element_by_id ('fineui_34 ' ) \
143
- .find_element_by_id ('fineui_35 ' )
144
+ yes_button_2 = browser .find_element_by_id ('fineui_39 ' ) \
145
+ .find_element_by_id ('fineui_41 ' ) \
146
+ .find_element_by_id ('fineui_42 ' )
144
147
yes_button_2 .click ()
145
148
time .sleep (1 )
146
149
0 commit comments