PhantomJS switchToParentFrame () 方法详解与实例


发布日期 : 2020-04-12 02:18:28 UTC

访问量: 10 次浏览

PhantomJS switchToParentFrame()

switchToParentFrame() 用于获取当前子frame的父frame。

语法

switchToParentFrame() 语法如下所示 −

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

示例

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

上面的程序生成以下输出

page2