Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

387
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda