How to Capture text from Captcha Image
Capturing text from captcha images can be a crucial part of data processing and automation workflows. This guide walks you through the steps to achieve this using built-in commands and configurations.
Overview
This process involves downloading captcha image, converting image to text, and extracting the transcribed content for further use. Follow the steps below to capture and process text from image efficiently.
Step 1: Download the Captcha Image
Add a URL command: Use the URL Command to load a specified URL.
Now select the captcha Image and click on the Image icon as shown below and it will add the command under the url command.
Step 2: Now add the convert content command to process the captcha image and select Image To Text as the converter type from the dropdown menu.
Step 3: Choose a CAPTCHA Service Provider from the dropdown menu and configure its API for image-to-text conversion as shown in the screenshot below -
Step 4: Next to add the Captcha Input command to enter the converted value in input box as shown below -
In order to get/view the converted text, one needs to add a Data Value Captcha Input command and need to select the Input Action Action Result in the Input drop down menu and use the Converted Value in the following field.
Step 5: After that, add the Submit Action command to finalize the capture text from captcha image process.
Note: Additionally, you can generate the agent in text format by clicking on the 'Text' option in the right panel.
This text format can be saved locally by clicking the option available at the bottom.
Agent:
Proxies:
Run Without Proxies: true
Commands: URL
Dynamic Load:
Timeouts:
Discover Activity: 1
Input: https://training.sequentum.com/captcha/captchaimageiframe
Commands:
- File Link: Captcha Image
Extract: //img[@id='captcha-image']
Attribute: Image URL
- Convert Content: Convert Content
Converter: Image To Text
Provider: Two CAPTCHA
Key: 83i17UfwjmsldfGuSbmG+YfjJSIQOmprZyjzTmz636KNs8+x9x1C0L0JvL71cg6Wo92wRWgj4y9eA4i+Po7FMg==
Arguments:
File: ${Captcha Image}
Lang: en
CaseSensitive: true
Commands: Input Action
Name: Captcha Input
Input:
Result Value: Converted Value
Select: //input[@id='captcha-input']
Dynamic Load:
Timeouts:
Discover Activity: 1
Discover First Activity: 1
Commands: Action
Name: Submit Action
Select: //button[@class='btn btn-primary']
Dynamic Load:
Timeouts:
Discover Activity: 1
Discover First Activity: 1
Commands: Content
Name: Submit
Extract: //button[@class='btn btn-primary']
Export:
Commands: CSV