casperjs iframe, javascript looks like deactivated

179 Views Asked by At

I try to go in a iframe of a page and get javascript error.I have a page with this structure.

<html>
  <body>
    <iframe name="ifrm">
      <frameset id="mainset">
        <frame name="navi"></frame>
        <frame name="main"></frame>
        <frame name="navi2"></frame>
      </frameset>
    </iframe>
  </body>
</html>
        

If i try to go in a frame, to click a link or something i get a javascript error, which means i had deactivate javascript.

casper = require('casper').create({
    pageSettings: {
        javascriptEnabled: true
    },
    loadPlugins: true,
    logLevel: 'debug',
    XSSAuditingEnabled: true,
    verbose: true,
    viewportSize: { width: 1920, height: 1080}
});


casper.userAgent('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36');

casper.start(url, function() {
  
    this.page.switchToChildFrame(1);
    this.page.switchToChildFrame(0)
});

casper.then(function() {
    //get right frame and url - navi
    this.echo('url is ' + this.getCurrentUrl());
    
    //get correct rendered page without javascript errors
    casper.capture('page.png');
  
    //get no really html structure because of the page think javascript is          deactivated
    this.echo(this.page.content);
   
});

casper.run();

Iam confused because the capture show a correct rendered page. And in this screenshot the page did not say that he miss javascript. But in the code i have the error.

The output:

<iframe  scrolling="no" frameborder="0" style="height: 100%; width: 100%; border: 0" name="ifrm" id="ifrm">
 Ihr Browser kann leider keine eingebetteten Frames anzeigen.
 &lt;br&gt;&lt;br&gt;
 Es ist sehr wahrscheinlich, dass Sie JavaScript deaktiviert haben.
 </iframe>

-> Your browser does not support iframes .
-> It is very likely that you have JavaScript disabled .

0

There are 0 best solutions below