Reputation: 55
I want to get the value of input type = "hidden" name = "CRAFT_CSRF_TOKEN" value="dfsdgdg"
below is the response that I am getting for my first request. I want to read the value from the first request and use it in my subsequent request. I tried using a regular expression extractor, CSS selector extractor and XPath extractor none of them workedenter image description hereenter image description here input type="hidden" name="CRAFT_CSRF_TOKEN" value="4edwUQQn9gYbf5zYjz4fuRIfyu3lzoXi3_27IU7Jj54RLskSWvVvnKadSTdGYpVofQmqn79hT9dHLYeBsZf0h6-M9HErsMb6eXiHWTXHXt4="
Upvotes: 1
Views: 1252
Reputation: 1821
You can use the XPath Extractor, XPath2 Extractor and CSS Extractor as in the other answer. They all work well if your response is a valid HTML.
Here is another option with a Regular Expression Extractor.
Regular expression
name="CRAFT_CSRF_TOKEN" value="(.*?)"
Note: You can validate the syntax of regular expressions, CSS, XPath, etc in the View Result Tree.
Upvotes: 1