How can I set some data from a received response witch format is TEXT in postman

199 Views Asked by At

I want to set some data in the environment from a received response witch format is TEXT in postman. any idea of doing this. thanks a lot, for example, the highlighted phone number. tried to change response type to JSON but that makes things even worse.

enter image description here

1

There are 1 best solutions below

0
On

You can use cheerio to parse the HTML response received in the Tests script and pick any data you want from the parsed HTML.

const cheerio = require('cheerio')
const $ = cheerio.load(pm.response.text())

...