Cita: var w=document.getElementById('miframe');
var bodyIframe = w.contentWindow.document;
alert(bodyIframe);
Eso no te da el body sino el document del iframe.
Para obtener el html correspondiente a un elemento con id "pp" del iframe con id miframe, sería así:
Código PHP:
ifr=document.getElementById('miframe');
docIfr=ifr.contentDocument || ifr.contentWindow.document;
htmlPP=docIfr.getElementById('pp').innerHTML;
y si pp fuera un campo de formulario, para obtener su atributo value, sería así:
Código PHP:
ifr=document.getElementById('miframe');
docIfr=ifr.contentDocument || ifr.contentWindow.document;
htmlPP=docIfr.getElementById('pp').value;