Phantomjs-switchtoframe-method

提供:Dev Guides
移動先:案内検索

PhantomJS-switchToFrame()

指定した名前のフレームを選択します。これは現在のフレームの子でもあります。

構文

その構文は次のとおりです-

var wpage = require('webpage').create();
wpage.switchToFrame();

var page = require('webpage').create();
page.open('http://localhost/tasks/framesl', function(status) {
   page.switchToParentFrame();
   page.switchToFrame('myframe');
   console.log(page.frameName);
});

次の出力が生成されます。

Myframe