Set the amount of time that the script should wait during an execute_async_script call before throwing an erro

master
Max 2023-07-13 10:55:51 +08:00 committed by GitHub
parent 695af90705
commit 8d874fe147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -2767,6 +2767,7 @@ def tixcraft_get_ocr_answer(driver, ocr, ocr_captcha_image_source, Captcha_Brows
#image_id = 'TicketForm_verifyCode-image'
pass
try:
driver.set_script_timeout(3)
form_verifyCode_base64 = driver.execute_async_script("""
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
@ -7783,6 +7784,7 @@ def ibon_auto_ocr(driver, config_dict, ocr, away_from_keyboard_enable, previous_
if not image_element is None:
try:
driver.set_script_timeout(3)
form_verifyCode_base64 = driver.execute_async_script("""
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
@ -9783,6 +9785,7 @@ def kham_auto_ocr(driver, config_dict, ocr, away_from_keyboard_enable, previous_
if not image_element is None:
try:
driver.set_script_timeout(3)
form_verifyCode_base64 = driver.execute_async_script("""
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
@ -10670,6 +10673,7 @@ def ticketplus_auto_ocr(driver, config_dict, ocr, previous_answer, Captcha_Brows
if not image_element is None:
try:
driver.set_script_timeout(3)
form_verifyCode_base64 = driver.execute_async_script("""
function svgToPng(svg, callback) {
const url = getSvgUrl(svg);