I'm working on this test where I have to get the contents of a pdf file. The html structure (after rendering on client side on a traditional browser) is something like this
<iframe id="frame" name="frame" src="a link" id="frame" >
<embed id="plugin" src="src to pdf file">
pdf shows up here
</embed
</iframe>
When I output the html on casper the iframe contents is empty, my code is something like this
casper.then(function(){
this.wait(5000);
casper.withFrame('frame', function(){
//the page renders whell but it won't show the pdf
this.capture('pic.png');
this.evaluate(function(){
//finds
document.querySelector('body');
//returns null
document.querySelector('embed');
});
});
);
I don't understand why phantom won't render the element with the pdf file, is there a workaround for this?