Home>

Error of the incitement, I can not understand why (can anyone help? Here is a part of the code. Thank you for your answers.

Try:
    user.login ('password')
Except (wa.captcharequired, wa.loginincorrect) AS EXP:
    If Isinstance (EXP, LOGININCORRECT):
        # Ask for new password
    ELSE:
        password= self.password.
    if isinstance (exp, wa.captcharequired):
        Print User.Captcha_URL
        # Ask a Human to Solve Captcha
    ELSE:
        CAPTCHA= NONE.
    user.login (Password= Password, Captcha= Captcha)
Except Wa.EmailCoderequired:
    user.login (email_code= 'zxc123')
Except Wa.Twofactorcoderequired:
    user.login (twofactor_code= 'zxc123')

Error line 4 "Else:"

  • Answer # 1

    in the code on Python should not be empty or consisting only from the comments of the code blocks (for example, inside if ). Need to add at least Pass :

    If Isinstance (Exp, LoginIncorRect):
        # Ask for new password
        Pass
    ELSE:
        password= self.password.
    
  • Answer # 2

    in the code on Python should not be empty or consisting only from the comments of the code blocks (for example, inside if ). Need to add at least Pass :

    If Isinstance (Exp, LoginIncorRect):
        # Ask for new password
        Pass
    ELSE:
        password= self.password.