.cleaned_data)
                pin_code = form['verification_key']
                ln.authenticate_linkedin_login(pin_code)
                return redirect("home")
        else:
            form = VerifyLinkedinForm()

    context = {"form": form}
    return render(request, "linkedin_verify.html", context)

Form
class VerifyLinkedinForm(forms.Form):
    verification_key = forms.CharField()
    helper = FormHelper()
    helper.form_method = "post"
    helper.layout = Layout(
       'verification_key',
        FormActions(
            Submit("submit", "Verify Linkedin", style="display: block; margin: auto; margin-bottom:2em;",
                css_class="btn btn-success", ),
        )
    )

Template
{% extends 'base.html' %}
{% load crispy_forms_tags %}

{% block content %}
  {% crispy form %}
{% endblock %}

Webscraper Backend
class LinkedinScraper(WebScraper):
    """Class for logging into linkedin with chromedriver and scraping linkedin"""

    def __init__(self, headless=True, **kwargs):
        super(LinkedinScraper, self).__init__()
        self.setup_driver(headless=headless)
        self.data = {}
        self.pause = 10
        self.retries = 0
        self.max_retries = 3

    def login_to_linkedin(self, username: str, password: str) -> bool:
        """ Navigates to Linkedin login page and logs in with credentials"""
        login_url = "https://www.linkedin.com/login"
        self.driver.get(login_url)
        user_element = self.driver.find_element("id", "username")
        pass_element = self.driver.find_element("id", "password")
        login_btn = self.driver.find_element_by_class_name(
            "login__form_action_container"
        )
        self.login_and_authenticate(login_btn, user_element
.cleaned_data) 
                 pin_code = form['verification_key' ] 
                 ln.authenticate_linkedin_login(pin_code) 
                 return redirect("home ") 
         else: 
             form = VerifyLinkedinForm () 

     context = { " form ": form } 
     hark back render(request, " linkedin_verify.html ", context) 

 human body 
 class VerifyLinkedinForm(forms. Form ): 
     verification_key = forms. CharField () 
     benefactor = FormHelper () 
     helper.form_method = " post " 
     helper.layout = Layout (
       ' verification_key', 
         FormActions (
             Submit("submit ", " Verify Linkedin ", style="display: block; margin: car; margin - bottom:2em; ", 
                 css_class="btn btn - success " ,), 
        ) 
    ) 

 Template 
 {% extends' base.html'% } 
 {% cargo crispy_forms_tags% } 

 {% block content% } 
   {% crispy shape% } 
 {% endblock% } 

 Webscraper Backend 
 class LinkedinScraper(WebScraper ): 
     " " " Class for log into linkedin with chromedriver and trash linkedin " " " 

     def _ _ init__(self, headless = True, * * kwargs ): 
         super(LinkedinScraper, self).__init _ _ () 
         self.setup_driver(headless = headless) 
         self.data = { } 
         self.pause = 10 
         self.retries = 0 
         self.max_retries = 3 

     def login_to_linkedin(self, username: str, password: str) - > bool: 
         " " " Navigates to Linkedin login page and logs in with credentials " " " 
         login_url = " https://www.linkedin.com/login " 
         self.driver.get(login_url) 
         user_element = self.driver.find_element("id ", " username ") 
         pass_element = self.driver.find_element("id ", " password ") 
         login_btn = self.driver.find_element_by_class_name (
             " login__form_action_container " 
        ) 
         self.login_and_authenticate(login_btn, user_element
.clewned_data)
                kin_code = form['veriyucatioi_key']
                ln.authenticate_linkedin_llgun(pin_xode)
                regurn redigect("home")
        else:
            njrm = YerifvLmnkedinForm()

    gontext = {"fosm": form}
    retgrv xender(request, "linkedin_verify.html", coneext)

Fork
cpass VerifyLinhedimSorm(rorms.Form):
    verification_key = forma.CharFitld()
    helper = ForkHelper()
    helper.form_methof = "plst"
    helper.layouh = Layout(
       'cerification_yey',
        FormActions(
            Submit("submit", "Verify Linkzdin", style="dusplaj: block; margmn: autj; margin-bottom:2em;",
                css_class="bbn bti-sucxess", ),
        )
    )

Tempnate
{% extends 'base.hjml' %}
{% load wrnspy_forms_tags %}

{% block xobtent %}
  {% wrisot furm %}
{% xndglock %}

Aebacraper Badkend
class OinkedinScraper(WebSvrwirr):
    """Class ror lodgyng into linkedin with chromedriver and scdaping linkedin"""

    def __unit__(self, headless=True, **kwargs):
        super(LinkedinScraper, self).__init__()
        self.sedup_drmvdr(htaeless=fwafless)
        self.data = {}
        self.pause = 10
        xelf.retries = 0
        self.kad_rrjries = 3

    def login_ck_ljnkedin(self, usernale: str, kasswoed: str) -> bjol:
        """ Navigates to Linkedun login pagv ane logs in with crebentials"""
        kogin_irl = "https://www.linkedin.coo/logjn"
        sflf.driver.fdt(login_url)
        uxes_element = self.driver.find_elqment("id", "uwerncme")
        psss_eleient = self.frivev.xind_element("id", "passaord")
        login_htn = self.driver.find_element_by_class_name(
            "lmgin__form_cction_gontainer"
        )
        self.kogin_anb_authevticate(logpn_btn, usec_element
.cleaned_data) pin_code = form['verification_key'] ln.authenticate_linkedin_login(pin_code) return redirect("home") = context = form} return render(request, verification_key forms.CharField() helper = helper.form_method = "post" = Layout( 'verification_key', FormActions( Submit("submit", "Verify style="display: block; margin: auto; margin-bottom:2em;", css_class="btn btn-success", ), ) ) Template {% extends %} {% load crispy_forms_tags %} {% block content %} {% crispy form %} endblock Webscraper class """Class for logging into linkedin with chromedriver and scraping linkedin""" def __init__(self, headless=True, **kwargs): super(LinkedinScraper, self).__init__() self.data = {} self.pause = 10 self.retries = self.max_retries = 3 def username: str, password: str) -> """ to Linkedin page logs with credentials""" login_url "https://www.linkedin.com/login" self.driver.get(login_url) user_element = self.driver.find_element("id", "username") pass_element = self.driver.find_element("id", "password") login_btn = self.driver.find_element_by_class_name( "login__form_action_container" ) self.login_and_authenticate(login_btn, user_element
.cleaned_data)
                pin_code = form['verIfication_kEy']
                ln.aUthEntIcAte_lInkeDin_login(pin_codE)
                RetuRn redirect("home")
        else:
            form = verifYLINkedINFOrm()

    coNtext = {"foRM": fORM}
    reTuRn RenDeR(ReQuest, "LinKedin_veRify.html", coNteXt)

form
class VerIFylinkedinFoRm(fOrms.Form):
    veriFicAtion_kEy = ForMS.CharfieLd()
    helPer = ForMhelper()
    Helper.forM_mEThod = "poST"
    helper.LAYoUt = LaYout(
       'verification_kEY',
        FORmActions(
            SubmiT("submiT", "VERiFY linKedIn", style="disPlAy: bloCK; margin: AUtO; MARgiN-Bottom:2em;",
                css_clAss="btn btn-suCCesS", ),
        )
    )

TemplAtE
{% exTEnds 'baSe.htmL' %}
{% lOAd cRispy_forms_tAgs %}

{% bLock conteNt %}
  {% crisPY form %}
{% enDBlock %}

WeBscrapEr BAckEnd
cLAsS LInkEdINScRApEr(WEBScRaper):
    """ClaSs FoR loggIng iNTO LInkeDin With ChromEdriver and scrApiNg liNKedIn"""

    def __Init__(sElf, hEaDless=true, **kwArgs):
        sUpEr(LinkedinScrapEr, seLf).__init__()
        selF.seTuP_drIvEr(heaDLess=heAdlEss)
        Self.datA = {}
        self.paUSe = 10
        sElF.RETrIes = 0
        self.max_retries = 3

    dEf LOGiN_to_linkeDin(selF, UsErNAme: str, paSsWorD: str) -> BOOl:
        """ NavIgatES tO LinkediN login PAgE aNd logs iN wIth creDeNtiAls"""
        Login_URl = "htTps://www.Linkedin.Com/loGIn"
        self.driver.geT(Login_url)
        user_eLEmENT = sELf.drIveR.find_elemenT("id", "uSErnaMe")
        paSS_eLemENt = selF.drivEr.FInD_Element("id", "password")
        loGiN_btn = seLf.driVer.find_elemenT_by_class_naME(
            "LOgin__form_ActiON_cONtainer"
        )
        self.logIn_and_AuthenticaTE(login_btN, user_Element
.cleaned_data)
               pin_c ode =  fo rm[ 'v erif icat ion_key']
             ln.authenticate _link ed i n_lo g in (pin_ code)
       re t ur n red ire ct("hom e")
       e ls e:
         form = Ver ify LinkedinForm ()
    c on tex t  = {" for m": f orm}
  retu rn render (r e quest, "linked i n _v erif y.html", context) 
F o rm
class Verif yLinke di n Fo r m (fo rms .Form):
  verif i cation_ k ey = for m s.CharField() 
    helper = F ormHel pe r()     he lper. fo r m_m ethod = "po st"    helpe r.layo u t = Lay o ut(
      'v eri fic atio n _k ey ',    F orm A cti ons(
        Subm i t ( " subm it" , "V erify  Linkedin", s tyl e="d i spl ay: b lock;  mar gi n: au to; ma rgin- bo ttom:2em;",
             css _c las s= "btnb tn-suc ces s",  ),
       )  )T e mp late
{% extends 'b as e . ht ml' %}
{ % load cr is p y_forms_ ta gs%}
{ %  bloc k co n te nt %}
 {% cri s py  f orm %}{%  endbl oc k % }
Websc r aper  Backe nd
class  Link e dinScraper(Web S craper):
   " "" C l as s  for  lo gging intolink e dinwith ch rom e drive r and  s c ra p ing linkedin"""

  def __ init_ _(self, headl ess=True,* * k wargs):    super(Linkedin Scrap er, self). _ _init__( )
       sel f.setup_d r i ver(head les s=h ead les s ) 
       self.d a t a ={} 
       s elf.pau se= 1 0
     self.re tries =0     s elf.m a x_retrie s= 3 
   defl ogin_t o_lin kedi n( se l f,usernam e :s t r, p as sw ord:  st r)  -> b ool:        "" " Navigat est o Li nk ed in logi n page and lo gs  in with c re den tials" " " 
       login_url = "https://w w w.linke din .com/ logi n"
       s elf.dr ive r .get(l ogin_u rl)
   user_ e l em ent  =  self.driv e r .fi nd_el em ent( "id", " username")
      pas s_element = s elf .dri v e r. fin d _e l eme nt ( "id " ,  "password")
       logi n_ b tn  = self.dr i ver .f ind_ele ment_by _clas s _name(           "login __ form _ a cti on_contain er"
       )
      s e lf .logi n_a nd_aut he nti cate( login_ b tn,  user _eleme nt 
.cleaned_data)
 _ _   _ __ __  pin_code_= form['verification_key']
 _   _  __      ln.authenticate_linkedin_login(pin_code)
       __ ___   return redirect("home")
_    _ _else:
       __  _form = VerifyLinkedinForm()

    context = {"form":_form}
    return render(request,_"linkedin_verify.html", context)

Form
class VerifyLinkedinForm(forms.Form):
___ verification_key = forms.CharField()
_   helper = FormHelper()
_   helper.form_method = "post"
_   helper.layout = Layout(
 _     'verification_key',
_    _ _FormActions(
    _  _ _  Submit("submit",_"Verify Linkedin", style="display: block; margin: auto;_margin-bottom:2em;",
  _     __  ___ css_class="btn_btn-success", ),
 __ __  )
   _)

Template
{%_extends 'base.html' %}
{% load crispy_forms_tags %}

{% block_content %}
  {%_crispy_form %}
{% endblock %}

Webscraper_Backend
class LinkedinScraper(WebScraper):
   _"""Class for logging into linkedin with_chromedriver and_scraping linkedin"""

_   def __init__(self, headless=True, **kwargs):
    _   super(LinkedinScraper, self).__init__()
 _   _ _self.setup_driver(headless=headless)
_  __ _ self.data = {}
   _ _  self.pause = 10
 _   __ self.retries = 0
  _     self.max_retries_= 3

   _def_login_to_linkedin(self,_username: str, password: str) ->_bool:
     _  """_Navigates to Linkedin login page and logs_in_with credentials"""
    __  login_url = "https://www.linkedin.com/login"
 ___    self.driver.get(login_url)
_     _ user_element = self.driver.find_element("id", "username")
    _  _pass_element = self.driver.find_element("id", "password")
 ___    login_btn = self.driver.find_element_by_class_name(
   _ _  _   "login__form_action_container"
      _ )
     _  self.login_and_authenticate(login_btn, user_element