@@ -16,12 +16,11 @@ def __init__(self):
16
16
self .max_delay_interval = 5
17
17
18
18
# Nothing will happen if these are changed
19
- self .question_tracker = 0
20
19
self .question_answering_delay = 0
21
- self .answer_gathering_delay = 2.5
22
20
self .limit = 666
23
21
24
22
# Algo-related variables
23
+ self .question_tracker = 0
25
24
self .answering_page = ""
26
25
self .question_hash = ""
27
26
self .answers_in_page = []
@@ -67,8 +66,9 @@ def get_correct_answer(self, browser):
67
66
# Click the I don't know button
68
67
browser .driver .find_element_by_xpath ('/html/body/div[2]/div/div/div[2]/div[2]/div/div[1]/div/div[2]/div[4]/div[5]/a/div/div[2]' ).click ()
69
68
70
- self .answer_gathering_delay = random .randint (self .min_delay_interval ,self .max_delay_interval )
71
- time .sleep (self .answer_gathering_delay + 2 )
69
+ self .question_answering_delay = random .randint (self .min_delay_interval ,self .max_delay_interval )
70
+ print (f'Delay set to { self .question_answering_delay + 2 } seconds. (Questions answered so far: { self .question_tracker } )' )
71
+ time .sleep (self .question_answering_delay + 2 )
72
72
73
73
#We loop through all the buttons and we find the one with a different color than blue (that is the correct answer)
74
74
for buttons in range (1 ,5 ):
@@ -81,7 +81,7 @@ def get_correct_answer(self, browser):
81
81
def click_correct_button (self , browser , ans ):
82
82
83
83
self .question_answering_delay = random .randint (self .min_delay_interval ,self .max_delay_interval )
84
- print (f'Delay set to { self .question_answering_delay } seconds.' )
84
+ print (f'Delay set to { self .question_answering_delay } seconds. (Questions answered so far: { self . question_tracker } ) ' )
85
85
time .sleep (self .question_answering_delay )
86
86
87
87
# Loop through every answer button and see which one matches with our potential answer
@@ -128,9 +128,4 @@ def answer_question(self, browser):
128
128
self .scraped_data [f'{ self .question_hash } ' ] = [self .get_correct_answer (browser )]
129
129
self .update_hashes ()
130
130
131
-
132
-
133
-
134
-
135
-
136
-
131
+
0 commit comments