How to submit google captcha without submit button?

I'm writing an automation script using python and selenium, but I'm having a problem with the last step as the previous steps had submit button under captcha so the form was submitted. I was thinking about pay loading directly captcha response to the site but I didn't find any method to do this.

I'm using 2captcha automated resolving.

I have found this video that submits captcha I've looked into the code but I can't tell if it will work with my code

This is part of my code relevant to this question
def captchaHome():
    driver.execute_script('var element=document.getElementById("g-recaptcha-response");"";')
    service_key = 'xxxxxxxxxxxxxxxxxxxxxx'  # 2captcha service key
    google_site_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'  # reCAPTCHAのdata-sitekey
    pageurl = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    url = "" + service_key + "&method=userrecaptcha&googlekey=" + google_site_key + "&pageurl=" + pageurl
    resp = requests.get(url)
    if resp.text[0:2] != 'OK':
        quit('Service error. Error code:' + resp.text)
    captcha_id = resp.text[3:]
    fetch_url = "" + service_key + "&action=get&id=" + captcha_id

    for i in range(1, 10):
        time.sleep(10)  # wait 10 sec.
        resp = requests.get(fetch_url)
        if resp.text[0:2] == 'OK':
    print('Google response token: ', resp.text[3:])
    return resp.text[3:]

capHome = captchaHome()

This is a code from the site I want to submit
 function show(classNames) {
            classNames.forEach(function(className) {

          function hide(classNames) {
            classNames.forEach(function(className) {

          function showAnimation() {
            hide(['.challenge', '.error', '.success']);
            show(['.redeem', '.animation']);

          function showSuccess() {
            hide(['.challenge', '.error']);
            show(['.redeem', '.success', '.animation']);

          function showError() {
            hide(['.challenge', '.success', '.animation']);
            show(['.redeem', '.error']);

          // used in data-callback
          function redemptionValidation(captchaResponse) {

            function reqListener() {
              if (this.status >= 200 && this.status < 400) {
                var redirectUrl = this.responseText;
                setTimeout(function() {
                }, 3000);
              } else {

            function reqErrListener() {

            var req = new XMLHttpRequest();
            req.addEventListener('load', reqListener);
            req.addEventListener('error', reqErrListener);
  'POST', '/googlehome/redeem/getcode/');
            req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            req.send('g-recaptcha-response=' + encodeURIComponent(captchaResponse));
So I want to submit captcha without submit button so it can redirect me to next step.


I was thinking about payloading submit button to the site but I can't find any way to do this something like this

// 1. Create the button
var button = document.createElement("button");
button.innerHTML = "Do Something";

// 2. Append somewhere
var cap = document.getElementsByTagName("body")[0];
Then find it with selenium and click()