访问量: 10 次浏览
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