How to extract an value from HTMl


  1. How to extract an value from HTML

a href="/apps/…do?actionType=adminPage&authtoken=d8f8f981-f7a9-4ba1-9cd9-03e9b60a91cb" onClick = "javascript:

how to extract authtoken value from the above one.

2 . how to extract from jsonResponse want to store in each item in variable
({“data”:"1, 2, 3}),

Thanks in Advance

Gatling http checks page has all the solutions.

  1. if you want to extract from string then use Regex. If you want the the whole href, you can also use CSS (link).

  2. For Json, search for jsonPath on this page.


I tried with both regex and css but i am not able to get the value of authtoken (refered above)

1 .check (regex("""“authtoken”="([^"]*)""").saveAs(“AuthToken”))
2. .check (css(“href=”/apps/…do?actionType=adminPage", “authtoken”).saveAs(“AuthToken”))

with css i am getting the below error

,UTF-8),Map(),2285,UTF-8,RequestTimings(1440478289443,1440478289445,1440478289976,1440478289976)))), forwarding user to the next action
jodd.csselly.CSSellyException: Invalid combinator <=>. (state: 6)
at jodd.csselly.CSSellyLexer.yylex( ~[jodd-lagarto-3.6.5.jar:3.6.5]
at jodd.csselly.CSSelly.parse( ~[jodd-lagarto-3.6.5.jar:3.6.5]
at jodd.csselly.CSSelly.parse( ~[jodd-lagarto-3.6.5.jar:3.6.5]

using Gatling 2.2 version

Try following


.check (regex("""authtoken=([^"]*)""").saveAs("Authtoken") //-

2 for CSS parser I will need entire html. You can use the following site to test out CSS parser

  • Can you help to get value from json Response using json parser

My Json String =({“data”:"1, 2, 3})



You can use this link to test your json parser yourself - Select Stefan Goessner implementation

Quick tutorial on jsonPath syntax -

Hi Abhinav,

Thanks again.

i used jsonPath("$")previously so i didn’t get what i am expected,**Thanks it is also working fine with jsonPath("$.data")…**