How to parse the HTML response in K6

Above is the line from html response of one request. From this i need to get the values for the ones that are in in k6. As these values are to be parsed to next request.

Hello!
You can use Selection.find(selector) or another Selection

can i get the solution for this pls. i tried using the selection. But couldn’t succeed. so can i get some help from anyone who can help me in extracting these values. Thanks.

This is the documentation for parseHTML() and some examples: parseHTML( src )

What are the problems you encountered with it?

I haved used something like below. But i am not getting the values.
const pageTitle = doc.find(‘form’).children();
console.log('pageTitle form: ',pageTitle.text());

I need to extract the value that is matching with some regular expression. Is it possible with k6?

if not can u share the possible solution for extracting the value for execution id, session id, tab id in the abv provided html.

Sorry, I can’t write your script for you. I suggest using a lot of console.log() to debug what happens at every step with the parseHTML() and Selection APIs

I can’t see the HTML, but if you’re looking for a simple function to extract a string from within a string using left/right boundaries, you may want to have a look at findBetween which is arguably easier to use than parseHTML().