how to get dynamic value from response body (body format is html).

Hi guys.

I have a question about how to get dynamic value from response body.

request_6 response body contains dynamic value “X-CSRF-TOKEN”, “X-CSRF-TOKEN” will be used in headers_4.

request_6 response html likes:

var CSRF_TOKEN = “5399f5a6-2adb-4db3-8052-3a088400f90e”;
var everbridgeIsFederalClient = false;

script as followed:

val headers_0 = Map(
“Accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”,
“Upgrade-Insecure-Requests” → “1”)

val headers_4 = Map(
“Content-Type” → “application/x-www-form-urlencoded; charset=UTF-8”,
“X-CSRF-TOKEN” → “7e0dce98-9832-4567-8b32-109c5ae88219”,
“X-Requested-With” → “XMLHttpRequest”)

.exec(http(“request_6”)
.get("/users/list")
.headers(headers_0)

.exec(http(“request_11”)
.post("/users")
.headers(headers_4)
.formParam("_search", “false”)
.formParam(“nd”, “1504591556332”)
.formParam(“size”, “25”)
.formParam(“page”, “1”)
.formParam(“sidx”, “lastname”)
.formParam(“sord”, “asc”)))

.
Thanks,
Tracy