Screen-CHAPTCHA
Command Description
Use Laiye IDP to identify the verification code in the specified screen area and return the result
Command Prototype
sRet = Mage.ScreenOCRVerifyCode(target,rect,config,time,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
target | True | decorator | @ui"" | Use mouse to select or cut off the target screen area including window, elements, range, etc |
rect | True | dictionary | {"x":0,"y":0,"width":0,"height":0} | The range that needs to be searched, the program will recognize in this range of the control, if the range is passed as {"x":0,"y":0,"width":0,"height":0}, then the control rectangle area Recognition within the scope |
config | True | expression | {} | Call configuration of Laiye IDP |
time | True | number | 30000 | Specify the time in milliseconds to wait for a retry to find the text. If exceeded, an error will be thrown. Default: 30,000 milliseconds (30 seconds) |
bContinueOnError | None | boolean | None | Specify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value |
iDelayAfter | None | number | 300 | Delay time (in milliseconds) after executing the activity is 300 milliseconds |
iDelayBefore | None | number | 200 | The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds |
return
sRet,The variable used to save the output of the command.
Demo
Dim rect={"x":0,"y":0,"width":0,"height":0} // Default recognition range
Dim config={"Pubkey":"","Secret":"","Url":""} // Get from mage
Dim optionArgs={"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200} // Default optional parameters
TracePrint "--------------------Screen verification code recognition--------------------"
// --------------------------------------------------------
// [Remarks] Screen verification code recognition
// Input parameter 1:
// target--target element, the image verification code element used in this example is the image verification code element after opening "Beijing Electronic Taxation Bureau" in chrome.Url:https://etax.beijing.chinatax.gov.cn/ sso/login?service=http://etax.beijing.chinatax.gov.cn/xxmh/html/index_login.html?t=1643264339708
// Input parameter 2:
// rect--recognition range
// Input parameter 3:
// config--mage configuration, need to configure Pubkey and Secret.Type:Dict
// Input parameter 4:
// time--timeout time. Default unit: milliseconds. Type: Int
// Input parameter 5:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict
// Output parameters:
// sRet--The variable to which the output of the function call is saved
// Command prototype: sRet = Mage.ScreenOCRVerifyCode(target,rect,config,time,optionArgs)
// --------------------------------------------------------
sRet = Mage.ScreenOCRVerifyCode (@ui "<img>", rect, config, 30000, optionArgs)