PhantomJS - frameUrl 属性

此属性将返回当前焦点框架的 URL。

语法

其语法如下 −

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

示例

让我们举一个例子来了解 frameUrl 属性的用法。

var wpage = require('webpage').create(); 
wpage.open('http://localhost/tasks/content.html', function (status) { 
   console.log(status); 
   console.log(wpage.frameUrl); 
   phantom.exit(); 
}); 

上述程序生成以下输出。

success 
http://localhost/tasks/content.html

phantomjs_webpage_module_properties.html