- 檔案系統模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 系統模組
- PhantomJS - 屬性
- Web 伺服器模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 其他
- 命令列介面
- PhantomJS - 螢幕截圖
- PhantomJS - 頁面自動化
- PhantomJS - 網路監控
- PhantomJS - 測試
- PhantomJS - REPL
- PhantomJS - 示例
- PhantomJS 有用資源
- PhantomJS - 快速指南
- PhantomJS - 有用資源
- PhantomJS - 討論
PhantomJS - getPage()
此方法返回與 getpage 函式中傳遞的視窗名相匹配的子頁面。
語法
它的語法如下所示 −
wpage.getPage(windowname)
示例
以下示例顯示了 getPage() 方法的使用。
var wpage = require('webpage').create();
wpage.open('https:///tasks/test.html', function(status) {
var value = wpage.getPage("window2");
console.log(value);
phantom.exit();
});
上面的程式生成了以下輸出。
WebPage(name = "WebPage")
phantomjs_webpage_module_methods.htm
廣告