Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#E3FCEF

Please read the Terms of Use for Materials on ZennoLab

Table of contents

Expand
titleClick here to expand the table of contents
Table of Contents
exclude^Оглавление$

...

The action is used to automatically recognize captchas through services or manually .

Captcha (from CAPTCHA - eng. C ompletely A utomated P ublic T uring test to tell C omputers and H umans A part - a fully automated public Turing test for distinguishing between computers and people) - a computer test used to determine who a user of a system is: a person or a computer.

...

Some types of captcha

How to add an action to a project?

...

After adding an action, the manual captcha recognition window will immediately open, which you can close for now and go to the action settings.

...

  • Selecting a module (captcha service) through which the captcha will be recognized.

  • Select the desired captcha recognition service from the drop-down list (you must first specify its API key in the settings ). The default is MonkeyEnter.dll - manual input.

Project variables can be used in this field.

...

When you click on the Settings button, you will be taken to the program settings, to the captcha services tab

Element search

Include Page
Find items on a page
Find items on a page

...

The recognition result will be saved to the project variable specified here.

...

More

...

Expectation

...

Wait before executing - If positive numbers are specified in the FROM and TO fields, then the action will pause before starting work (the time will be randomly selected based on the specified range).

...

Expand
titleExamples of parameters from different services

Note

Additional parameters and the value that these parameters can take are individual for each service.

Let's consider a few examples based on two popular services for recognition captcha.

2Captcha - when you go to the page with the API description https://2captcha.com/2captcha-api#solving_normal_captcha, scrolling through the table below you can find a table where the parameters that can be specified

here is only a part of the possible parameters

Anti-Captcha - there is also a table with valid parameters on the documentation page for solving simple text captchas

Even based on only these two services and only a small part of their parameters, you can see that

  • some parameters that are responsible for the same are named differently (case sensitivity - case and regesense )

  • others have the same name, answer for the same thing, but accept different types of values ( phrase)

  • there are parameters that coincide in name, purpose, accepted values, but in one service slightly more values can be passed than in another ( numeric )

Note

Be extremely careful when writing a project for several captcha services using additional parameters.

...

  • Directory - the directory where the pictures will be saved (you can use variables )

  • Answers - where to save answers to captchas:

    • The file name is convenient, but not always suitable, since Captchas may contain characters that cannot be used in file names in Windows - \/:*?”<>|

    • To file - when this setting is selected, a captcha picture with the name captcha (X) .png will be saved in the specified directory , where X is the serial number of the captcha. A captcha (X) .txt file will also be created in which the answer to this captcha will be. In this case, the system's restrictions on file naming will no longer be scary.

  • Ignore answer “sorry” - for some errors, the Recognize captcha action returns sorry instead of answering the captcha. When this option is enabled, the program will not save captchas with this answer.

Where it can be useful:

  • if you want to create your own module for the CapMonster Cloud service.

  • when using CapMonster 2 (a program for automatic captcha recognition) - this software has a lot of captchas that it supports, as they say, out of the box, but there are also some for which you need to create modules yourself. And to create a module, you need a database of correctly recognized captchas, and this is where these action settings come to the rescue - you recognize the captcha manually or using services, save the captchas and answers, and then use them to train CapMonster 2.

...

Quite often, especially on weakly protected resources, a text captcha is encountered. It differs from a simple (graphic) captcha in that it is not drawn in a picture, but simply written in text. In principle, such a captcha does not need to be sent anywhere, it can be taken (parsed) directly from the text of the page. To parse the captcha from the text of the page, you need to take the text of the page using the Data action, select the text of the page and, by marking "parse the result", enter a regular expression for parsing the page in the parameters.

...

There is also a mathematical text captcha. This is the same text captcha, only it is usually used to write a mathematical expression like 58 + 63. You can turn this text into a picture and send it for recognition, or you can use JavaScript. To recognize the captcha, you can use a JavaScript action from the Custom Code category. In the field for the code, you can insert a link to the variable that contains the parsed expression, for example 58 + 63, and after execution the action will return the result 121.

...

If you come across a flash captcha, you can turn it (render) into a regular picture and also send it for recognition. Find this element in the tree of elements , right-click to bring up the menu to select actions on this element. Select the item "This is a captcha" there ... that's it!

...

Note

If you only need a screenshot of the browser window (visible area of the site), then it is better to use the Images Processing action

For this

  • add the Captcha Recognition action to the project (be sure to use the browser context menu: warning:, for this you can right-click on any picture on the site).

  • select CaptchaSaver.dll as the recognition module

  • enter the search criteria for the element for which you want to take a screenshot

  • in the Additional tab, in the Module parameters, specify the full path to save the image (you can use variable macros)

Expand
titleExample of action settings for a screenshot of the entire site

...

immediately after adding this action, a manual recognition window will open, you can close it

...

make sure you have specified the API key in the settings and the service has money

...

or you can manually find the field using Action designer and enter the answer using the Set Value action

Sticking

For this example, a page with the following content will be used:

...

First you need to stick all the individual pictures into one. Then, for the last action, select the required service (in this example, RuCaptcha) and in the Parameters on the Additional tab, indicate that a mathematical action should be performed here (for RuCaptcha - calc = 1 )

...