Upon loading quiz, the script would look for a link using .get_attribute that was associated with the first answer selection, then load it. Not sure if Microsoft changed things, but for the recent Indiana Jones quiz this link would take you somewhere slightly irrelevant and disrupt the quiz from finalizing.
I've removed that request that was done with these lines:
Our loop through selecting answers
#browser.execute_script(f"document.querySelector('#rqAnswerOption{i}').click();")
has now been slightly changed as on the Indiana Jones quiz there would be 2 identical rqAnswerOption elements on the page for each answer and this would only click the first that was found, when unfortunately the 2nd one was the one needed to be clicked.
Changed to this as a safety measure to click on all elements if duplicates are found, this should not disrupt if only one element for the answer exists.
browser.execute_script(f"document.querySelectorAll('#rqAnswerOption{i}').forEach(el=>el.click());")
I've noticed that on daily quizzes sometimes it will select Answer #1 for question 1, Answer #2 for Question 2, and then continue to loop, but this isn't a worry as it will go around again through the answers. Not sure if sleep timer needs to be increased or a reset in the for loop but not a big deal as of now. :)
Upon loading quiz, the script would look for a link using .get_attribute that was associated with the first answer selection, then load it. Not sure if Microsoft changed things, but for the recent Indiana Jones quiz this link would take you somewhere slightly irrelevant and disrupt the quiz from finalizing.
I've removed that request that was done with these lines:
Our loop through selecting answers
#browser.execute_script(f"document.querySelector('#rqAnswerOption{i}').click();")
has now been slightly changed as on the Indiana Jones quiz there would be 2 identical rqAnswerOption elements on the page for each answer and this would only click the first that was found, when unfortunately the 2nd one was the one needed to be clicked.Changed to this as a safety measure to click on all elements if duplicates are found, this should not disrupt if only one element for the answer exists.
browser.execute_script(f"document.querySelectorAll('#rqAnswerOption{i}').forEach(el=>el.click());")
I've noticed that on daily quizzes sometimes it will select Answer #1 for question 1, Answer #2 for Question 2, and then continue to loop, but this isn't a worry as it will go around again through the answers. Not sure if sleep timer needs to be increased or a reset in the for loop but not a big deal as of now. :)