Recaptcha automation (normal and invisible)New

This page is intended to demonstrate not only how our
API works but also how to use
it in a real life situation by completing a web form with reCAPTCHA, both in browser (selenium) and pure requests.
Examples are written in C# and Python, for both normal and invisible recaptcha.

Introduction

How does recaptcha work ?

As most of you already know, the google captcha is different from other captchas. They ask you to select multiple images... sometimes
the images you select refresh after clicking, sometimes they don't, making it trickier then it used to be in the back old days. Another
way they do it is instead of showing you the captcha when the page loaded, it shows it only when you click the submit button, which is called
invisible recaptcha.

After the captcha is completed, g-response-code (a key/string) is being sent with the request as a parameter when the form is submitted.

Whichever recaptcha it is, it can be solved with our service. There are two things we need from you in order to solve it and the g-response-code.

API usage

In order to for us to give you the g-response-code, we need two things from your end:

page_url - the URL where captcha was encountered

sitekey - a key/string that can be gathered from the source of the page, where captcha was found

You submit the page_url and site using our API (easiest to use our libraries) to our servers. Once submitted, we return a captcha ID. That
captcha ID is used to get the g-response-code. It takes few seconds until the g-response-code is available after submission, for
our workers to complete it.

Gathering the g-response-code from us, now you can bypass the page on which you encountered the captcha, either using a browser or
by submitting the form directly with requests.

Automation - browser and requests (C# & Python)

Recaptcha v2 - with callbackUPDATE

With the latest recaptcha updates, google added a new attribute to recaptcha, called data-callback.
The data-callback attribute has a JavaScript function, as value, which will be executed as soon as the recaptcha was successfully completed.
This allows the developers to submit the form (or do anything in JS for that matter), right after the captcha was completed, without having a Submit button.

The work flow for solving remains pretty much the same.
In order to bypass the captcha in this case, what we have to do is get the g-recaptcha-response from our service, set it in the webpage.
Here's how to do it with selenium:

Secondly, we have to locate the JS function that will be executed after recaptcha completion, which is the value of the data-callback attribute, of the
<div> that has the class g-recaptcha in the source code of the page, and looks like this:

From this part, we have to extract submit_it();, which is the function that is executed once recaptcha is completed.
We have to extract the exact name of it, so that we can execute it manually once we've set the g-recaptcha-response.
To execute JavaScript with selenium, as shown above, we can do it like this:

Recaptcha v2 - normal

We have a page set up for testing the normal recaptcha which can be found here.
It's a simple page though, that shows recaptcha too. It requires a first name, last name and email and captcha to be completed.
Once the form is submitted, the first name, last name and email and g-response-code are sent with a POST request to the same page, that checks if the g-response-code
is OK and returns accordingly.

In fact, this is the only important thing: 6LfgGSUUAAAAADGe-gOmrVEc8YEpfqkSJQ97HfoX, which is the sitekey. This is the second thing
that's needed for us, to complete it. The first one would be the page URL on which it captcha was found, which would be: http://URLLLLLL.com

To understand things better, let's take a look on how we could bypass this page in C# using selenium browser:

We don't have the <div> anymore, but we have the submit button, integrated with the captcha.
It contains the sitekey that we need. When the button is pressed, the captcha appears on page. After
completion, the form is submited through a JavaScript method. The request goes again with the g-response-code as
it did before with the normal captcha.

For this scenario, let's look at how we could complete it using C# and requests instead of a browser.