Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

386
Views
Postman - extracting value from HTML description list

I've searched for a while trying to find a way in Postman to extract a HTML description list value from the response body where the description list contains multiple values.

Example of response body:

<dl>
                    <dd>Fruit</dd>
                    <dt>Apple</dt>

                    <dd>Vegetable</dd>
                    <dt>Carrot</dt>
</dl>

How do I just get just the Vegetable value? I've tried using the following

const $ = cheerio.load(pm.response.text())
console.log('Vegetable', $('dt').text())

This then returns both values

"Vegetable" "AppleCarrot"

The Fruit & Vegetable values will change once the request is rerun, this means I'm unable to go just based off their names.

I'm probably over thinking this, thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

EricG posted the following above.

JQuery allows you to filter based off order using the following:

const $ = cheerio.load(pm.response.text())
console.log('Vegetable', $('dt').first().text())

Alternatively to the above if you need to go further down the list you can use:

const $ = cheerio.load(pm.response.text())
console.log('Vegetable', $('dt').eq(0).text())

Changing the value in .eq(#) starting from 0 will then following the items down the list.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!