How to insert a reCaptcha v2 solution
-
INSERTION
If you want to submit a form that requires a reCaptcha v2 verification, you will need to:-
solve the captcha through a
RECAPTCHA
block (you need to buy credit for one of the supported captcha solvers first). Let's assume you saved the challenge solution in theSOLUTION
variable. -
open the browser and navigate to the page
-
add an
EXECUTEJS
block and write
document.getElementById('g-recaptcha-response').innerHTML = '<SOLUTION>';
Example:
RECAPTCHA "https://www.google.com/recaptcha/api2/demo" "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" -> VAR "SOLUTION" BROWSERACTION Open NAVIGATE "https://www.google.com/recaptcha/api2/demo" EXECUTEJS "document.getElementById('g-recaptcha-response').innerHTML = '<SOLUTION>';" ## Now you can fill and submit your form
VALIDATION
Sometimes the reCaptcha must trigger a validation function after you inserted it inside the textarea.
You can easily see if that is the case by looking at the div using inspect element. For example on the reCaptcha demo site you can see this:<div id="recaptcha-demo" class="g-recaptcha" data-sitekey="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" data-callback="onSuccess"> </div>
The
onSuccess
function is the callback function when the challenge is solved.
In this case you just need to addonSuccess();
to your script and it will look like this:document.getElementById('g-recaptcha-response').innerHTML = '<SOLUTION>'; onSuccess();
-
-
It is very hard for me to understand how it works, could you please use the full code as an example here? I appreciate it.
-
@insanebeeftw i need too
-
hey ruri
any idea for this situation? i means it wont let submit form or click button of login until Recaptcha get "Checked"
-
@Ruri U said that the recaptcha tick may not show when u even after u solve the captcha with selenium. In my case the login button is disabled until the Recaptcha is selected. What can be done?
Pic: https://ibb.co/YRJfc23
-
Submit the form manually through Element Action submit
-
@Ruri that is what im talk about,submit from Form,just have result of "Please solve captcha"
-
ElementAction > Submit
address the correctform
element through Tag or Css selector
-
@Ruri said in How to insert a reCaptcha v2 solution:
ElementAction > Submit
address the correctform
element through Tag or Css selectorsir i know this,its what i'm talk about,in this situation,website wont accept solving captcha untill the captcha button was checked,if use submit only recive (captcha not solved,or captcha problem) error,not specific in one target,in every form that be like this,its same
-
What does this mean is it not working
https://ibb.co/F3s03Bg