title: Method Not Allowed (POST) when trying to use Selenium
body: <p>I'm trying to get this django app to work with selenium but it's just not working at all. The code is kind of messy right now since I'm trying to figure out how to do what I need to do (I have to write a web scraping script with Selenium that get's the person's commercial  id number in this site from the goverment and once they type it, right under should appear the name and last name of the person corresponding to the id that's available in one of the goverment's api. I honestly have no idea how to do this so I'm trying). The thing now is that I keep getting Method Not Allowed (POST): /constancia-inscripcion and Method Not Allowed: /constancia-inscripcion (405) everytime I submit a random number to the form. I think the error could be anywhere, to be honest, so I need some help to find it.</p>
  <p>This is my view:</p>
  <pre><code>from django.shortcuts import render, HttpResponse
  import requests
  from django.views import View
  
  from selenium import webdriver
  
  class ConstanciaInscripcion(View):
      
      DRIVER_PATH = 'C:/Users/micae/Documents/python/chromedriver.exe'
      driver = webdriver.Chrome(executable_path='C:/Users/micae/Documents/python/chromedriver.exe')
      driver.get('https://seti.afip.gob.ar/padron-puc-constancia-internet/ConsultaConstanciaAction.do')
      
      def get(self, request):
         return render(request, 'app/constancia-inscripcion.html')
         
      def cuit(request):
          
          information = []
  
          if request.method == 'POST':
              
              driver.find_element_by_xpath(&quot;//label[@class='cuit']/input[@class='word' and @type='text' and @value='']&quot;).click()
              driver.find_element_by_xpath(&quot;//label[@class='cuit']/input[@class='word' and @type='text' and @value='']&quot;).clear()
              driver.find_element_by_xpath(&quot;//label[@class='cuit']/input[@class='word' and @type='text' and @value='']&quot;).send_keys(&quot;&quot;)
  
              a5_url = 'https://aws.afip.gov.ar/srpadron/webservices/personaServiceA5'
  
              search_params: {
                  'persona' : 'a5:getPersona',
                  'token' : 'token',
                  'sign'  : 'sign',
                  'cuit' : 'cuitRepresentada',
                  'q' : request.POST['search']
              }
  
              r = requests.get(a5_url, params=search_params)
              results = r.json()
  
              if len(results):
                  for result in results:
                      person_data = {
                      'nombre' : result['nombre'],
                      'apellido': result['apellido'],
              }
                  information.append(person_data)  
          
              else:
                  message = print('El CUIT ingrasado es incorrecto')
  
              print(information)
       
  
          context = {
          'information' : information
          }
  
          return render(request,'app/constanciainscripcion.html', context)
            
          
      def email(request):
  
          if request.method == 'POST':
              form = ClientForm(request.POST)
              if form.is_valid():
                  # process form data
                  obj = Listing() #gets new object
              
                  obj.email = form.cleaned_data['email']
                  #finally save the object in db
                  obj.save()
  
          return render(request, 'app/constancia-inscripcion.html')
  
      def captcha(request):
          
          if request.method == 'POST':
              captcha_code = driver.find_element_by_xpath(&quot;//*[@id='CaptchaCode']&quot;).send_keys(CAPTCHA)
              captcha_field = driver.find_element_by_xpath(&quot;//*[@id='captchaField']&quot;).send_keys(CAPTCHA-FIELD)
              submit = driver.find_element_by_xpath(&quot;//*[@id='btnConsultar']&quot;).click()
              
              RECAPTCHA_SITE_KEY=&quot;6LdEnNsZAAAAAKotfjwOJsR4r8nvq5ADWhMZEqJ9&quot;
              RECAPTCHA_SECRET_KEY=&quot;6LdEnNsZAAAAANeDqX4oOOaPnidRtoG9yMApCl_t&quot;
      
          c_data = {
              'response': request.POST.get('g-recaptcha-response'),
              'secret': RECAPTCHA_SECRET_KEY
              }
      
          resp = requests.post('https://www.google.com/recaptcha/api/siteverify', data=c_data)
          captcha_response = resp.json()
   
          if not captcha_response.get('success') or captcha_response.get('score') &lt; 0.6:
              print('Captcha incorrecto')
          else:
              print('Captcha correcto')
  
      
      def send(request):
  
          if request.method == 'POST':
              print('Loading')
  
              if not EnvironmentError:
                  print( 'Sus datos fueron enviados correctamente, en un máximo de 2 hs. estarás recibiendo tu constancia por email.')
              else:
                  print('No hemos podido procesar su solicitud, por favor reintente nuevamente más tarde.')
  
          
          return render(request, 'app/constancia-inscripcion.html')
  
  </code></pre>
  <p>This is my urls:</p>
  <pre><code>from django.urls import path
  from . import views
  
  app_name = 'app'
  
  urlpatterns = [
      path('constancia-inscripcion', views.ConstanciaInscripcion.as_view(), name='constancia-inscripcion')
  
  ]
  </code></pre>