Phantomjs-switchtomainframe-method
提供:Dev Guides
PhantomJS-switchToMainFrame()
switchToMainFrame()メソッドは、メインフレーム、つまりルートウィンドウを選択します。
構文
その構文は次のとおりです-
var wpage = require('webpage').create();
wpage.switchToMainFrame();
例
var page = require('webpage').create();
page.open('http://localhost/tasks/framesl', function(status) {
page.switchToMainFrame();
console.log(page.frameName);
});
次の output が生成されます。
page2