Hi,
I have a postman response that comes back in HTML:
<!DOCTYPE html>
<title>Cardinal DDC Sim</title>
<script>
sendNotification(true, "c11d2d68-9f15-403c-80b6-e2f2ff815e24");
function sendNotification(status, sessionId){
try{
var message = {
MessageType: 'profile.completed',
SessionId: sessionId,
Status: status
};
window.parent.postMessage(JSON.stringify(message), '*');
} catch(error){
console.error('Failed to notify parent', error)
}
}
</script>
I need to capture the GUID only, but cannot seem to get cheerio to get it correctly. Could someone help guide me please?
const $ = cheerio.load(pm.response.text())
let str = $('script');
console.log(str);
const retrieve=str[0].children[0].data;
console.log(retrieve);
Will give me data, but then i cannot seem to trim it down