@@ -16,12 +16,11 @@ def __init__(self):
1616 self .max_delay_interval = 5
1717
1818 # Nothing will happen if these are changed
19- self .question_tracker = 0
2019 self .question_answering_delay = 0
21- self .answer_gathering_delay = 2.5
2220 self .limit = 666
2321
2422 # Algo-related variables
23+ self .question_tracker = 0
2524 self .answering_page = ""
2625 self .question_hash = ""
2726 self .answers_in_page = []
@@ -67,8 +66,9 @@ def get_correct_answer(self, browser):
6766 # Click the I don't know button
6867 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 ()
6968
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 )
7272
7373 #We loop through all the buttons and we find the one with a different color than blue (that is the correct answer)
7474 for buttons in range (1 ,5 ):
@@ -81,7 +81,7 @@ def get_correct_answer(self, browser):
8181 def click_correct_button (self , browser , ans ):
8282
8383 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 } ) ' )
8585 time .sleep (self .question_answering_delay )
8686
8787 # Loop through every answer button and see which one matches with our potential answer
@@ -128,9 +128,4 @@ def answer_question(self, browser):
128128 self .scraped_data [f'{ self .question_hash } ' ] = [self .get_correct_answer (browser )]
129129 self .update_hashes ()
130130
131-
132-
133-
134-
135-
136-
131+
0 commit comments