How to parse and extract data from HTML response for Rest API?


#1

Hi,

Is there any way to parse and extract data from HTML response for Rest API request?


#2

yes.
getResponseBodyContent() or getResponseBodyText() will just return a string with all the content.
if you need to extract something specific from the html … well, that’s another story.
you will need a custom parser, depending on the response content


#3

Hi,


Please find the attached screenshot for reference (postman response).

I want to extract the value for “__VIEWSTATE”

How should I parse this html response and get value for “__VIEWSTATE” ?


#4

jsoup may help, give it a try:


#5

Yes, I have tried jsoup and it is working for me. Thanks