I am trying to access the content of tag inside iframe.
structure of iframe is look like this:

there is json data inside the pre tag. how should I access it. I Tried all these:
const iframe = document.getElementById('iframe') as HTMLIFrameElement;
const theHtml = iframe.contentWindow.document.body.getElementsByTagName('pre')[0];
console.log(theHtml);
console.log(iframe.contentWindow);
console.log(iframe.contentWindow.document);
console.log(iframe.contentWindow.document.body);
console.log(iframe.contentWindow.document.body.innerHTML);
Can someone please help out.