need to test on mac os

This commit is contained in:
Lei PAN
2022-05-23 12:09:32 +02:00
parent f53db19569
commit e14ed405fb
2 changed files with 4 additions and 4 deletions
-1
View File
@@ -1,7 +1,6 @@
import random
# for recaptcha
import urllib
import pydub
from speech_recognition import Recognizer, AudioFile
import random
import os
+4 -3
View File
@@ -349,15 +349,16 @@ class CommandorPage:
while solution == CAPCHA_NOT_READY:
solution_res = requests.get(url_response)
print(solution_res.text)
time.sleep(5)
solution = solution_res.text
print(solution)
self.fill_captcha_solution(solution.split("|")[-1])
def fill_captcha_solution(self, solution):
self.logger.info("wil input solution: " + solution)
self.logger.info("will input solution: " + solution)
self.page.evaluate("""(solution)=>{
let captcha_response = document.getElementById("g-recaptcha-response");
captcha_response.innerHTML=solution;}}""", solution)
document.getElementById("g-recaptcha-response").innerHTML=solution;}""", solution)
self.logger.info("will click on valid btn")
self.clickOnValidBtn()