Getting a specific content in HTML response

Hey @gpub1

Would this give you what you need?

var cheerio = require('cheerio');

$ = cheerio.load(pm.response.text());
links = $('a');
$(links).each(function (i, link) {
    console.log(i + ': ' +  $(link).attr('href'));
});

I mocked out the request using your response example:

Used this SO answer as a reference:

4 Likes