- 檔案系統模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 系統模組
- PhantomJS - 屬性
- Web 伺服器模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 其他
- 命令列介面
- PhantomJS - 螢幕捕獲
- PhantomJS - 頁面自動化
- PhantomJS - 網路監控
- PhantomJS - 測試
- PhantomJS - REPL
- PhantomJS - 示例
- PhantomJS 有用資源
- PhantomJS - 快速指南
- PhantomJS - 有用資源
- PhantomJS - 討論
PhantomJS - close()
close() 方法用於關閉頁面並釋放所使用的記憶體。一旦呼叫關閉方法,任何網頁方法或屬性將不再起作用。
語法
其語法如下 -
wpage.close();
示例
以下示例演示如何使用 close() 方法。
var wpage = require('webpage').create();
wpage.open('https:///tasks/a.html', function() {
console.log("page is opened");
wpage.close();
phantom.exit();
});
以上程式生成以下 輸出。
page is opened
phantomjs_webpage_module_methods.htm
廣告