How to solve captcha with method using Selenium?

I was given a method to solve captchas on a website. The thing is, now that I wrote the scraping script, I don’t know how I’m supposed to use this method for it to solve me the captcha in my target website (I’m using selenium).
I located the element but that’s about it.

So where do I use the method? This is what I’m supposed to use:


This is my view:

from django.shortcuts import render, HttpResponse
import requests
from django.views.generic import FormView
from .forms import Mon
from app.ws_sr_padron import get_persona
from app.captcha import resolve_simple_captcha
from time import sleep

from selenium import webdriver
from import WebDriverWait
from import By
from import expected_conditions as EC

class ConstanciaInscripcion(FormView):

    def get(self, request):
       return render(request, 'app/constancia-inscripcion.html')
    def post(self,request):

        form = Mon(request.POST)
        email = request.POST['Email']

        cuit_r = int(request.POST["CUIT"])
        response = get_persona(cuit_r)
            nombre = response["persona"]["nombre"]
            apellido = response["persona"]["apellido"]
        except KeyError:
            nombre, apellido = None, None
            print("El CUIT ingresado es incorrecto")

        except TypeError:
            nombre, apellido = None, None
            print("El CUIT ingresado es incorrecto")
            print(nombre, apellido)
            if form.is_valid():
                cuit = form.cleaned_data.get('CUIT')
                email = form.cleaned_data.get('Email')
                return render(request, 'app/constancia-inscripcion.html')            

        #Selenium script
        DRIVER_PATH = 'C:/Users/chromedriver.exe'
        driver = webdriver.Chrome(executable_path=DRIVER_PATH)
        driver.get('') #I changed the url for this

        wait = WebDriverWait(driver, 30) 
        elem = wait.until(EC.presence_of_element_located((By.XPATH,"//input[@id='cuit']")))
        elem2 = wait.until(EC.presence_of_element_located((By.XPATH,"//input[@id='captchaField']")))

        elem3 = wait.until(EC.element_to_be_clickable((By.XPATH, '//div[@id="btnConsultar"]')))        

        return render(request, 'app/constancia-inscripcion.html')