
- 文件系统模块
- 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('http://localhost/tasks/a.html', function() { console.log("page is opened"); wpage.close(); phantom.exit(); });
以上程序生成以下 输出。
page is opened
phantomjs_webpage_module_methods.htm
广告