Problem to assing postdata

IF STRINGKEY @data.SOURCE Contains "data-sitekey=“ab9df583-48b9-4c1b-8ace-0ba504a8c6e7”
BLOCK:ConstantString
value = $“login=<input.USER>&password=<input.PASS>&g-recaptcha-response=”
=> VAR @AUTH
ENDBLOCK

ELSE

BLOCK:ConstantString
value = $“login=<input.USER>&password=<input.PASS>”
=> VAR @AUTH
ENDBLOCK

END

and I try to assign the AUTH variable to login postdata and it tells me that it does not exist in the current context , thanks.

Declare OUTSIDE the if, and then ASSIGN inside

i no understood,can you explain please.

BLOCK:ConstantString
=> VAR @AUTH
ENDBLOCK

IF STRINGKEY @data.SOURCE Contains "data-sitekey=\"ab9df583-48b9-4c1b-8ace-0ba504a8c6e7"
BLOCK:ConstantString
value = $"login=<input.USER>&password=<input.PASS>&g-recaptcha-response="
=> VAR @AUTH
ENDBLOCK

ELSE

BLOCK:ConstantString
value = $"login=<input.USER>&password=<input.PASS>"
=> VAR @AUTH
ENDBLOCK

END
1 Like

thanks now got diferent error.
No such label ‘LOGIN’ within the scope of the goto statement

IF STRINGKEY @data.SOURCE DoesNotContain "data-sitekey=\"35356356356356566"
JUMP #LOGIN
END
BLOCK:SolveCaptcha
LABEL:HCAP
  siteKey = "blabla"
  siteUrl = "https://sitecom/login.html"
  => VAR @CAP
ENDBLOCK
BLOCK:HttpRequest
 LABEL:LOGIN
  url = "https://site.com/"
  method = POST
  customHeaders = {("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"), ("Pragma", "no-cache"), ("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"), ("Accept-Language", "en-US,en;q=0.8"), ("Accept-Encoding", "gzip, deflate, br")}
  TYPE:STANDARD
  $"<AUTH>"
  "application/x-www-form-urlencoded"
ENDBLOCK

In OB2 you dont jump to block labels anymore like OB1.
You have to place the label manually

JUMP #LABEL

#LABEL
// blocks here
``
1 Like

Thanks now understood.