可以使用关键字"phantomjs"和文件名执行PhantomJS.例如,"phantomjs file.js".
您还可以将参数传递给"file.js",如下所示 :
phantomjs [options] file.js arg1 arg2 ...
让我们看一下命令行中的一些可用选项.
S.No | 选项&说明 |
---|---|
1 | --help或-h 将显示所有命令行选项.立即停止并且不会运行脚本传递. |
2 | - 版本或-v 打印正在运行的PhantomJS版本.这将停止执行脚本的执行. |
3 | - debug [true | false] 打印警告和调试消息.默认情况下,它设置为false.你也可以使用[yes | no]. |
4 | - cookies-file =/path/to/cookies.txt 要存储的文件名持久性cookies. |
5 | - diskcache = [true | false] 启用磁盘缓存.它还需要值[yes | no] |
6 | - disk-cahe-path 磁盘缓存路径. |
7 | --ignore-sslerrors = [true | false] 忽略SSL错误.例如 - 过期或自签名证书错误.默认值为false.它还需要值[yes | no]. |
8 | - loadimages = [true | false] 加载所有内嵌图像.默认值为true.它也需要[是|否]. |
9 | - local-storagepath =/some/path 保存LocalStorage内容和WebSQL内容的路径. |
10 | - local-storagequota = number 允许数据的最大大小. |
11 | - local-url-access 允许使用'file:///'网址(默认为true). |
12 | - local-to-remote-urlaccess = [ true | false] 允许本地内容访问远程URL.默认值为false.它还需要值[yes | no]. |
13 | - max-disk-cachesize = size 限制磁盘缓存的大小(KB) ) |
14 | - offline-storage-path 指定离线存储的位置. |
15 | - offline-storage-quota 以KB为单位设置离线存储的最大大小. |
16 | - outputencoding = encoding 设置用于终端输出的编码.默认值为utf-8. |
17 | - proxy = address:port 指定要使用的代理服务器(例如 - proxy = 192.168. 1.1:8080) |
18 | - proxytype = [http | socks5 | none] 指定代理服务器的类型(默认为http) |
19 | - proxy-auth 代理的身份验证信息.例如 - - proxy-auth =用户名:密码 |
20 | - scriptencoding = encoding 设置用于脚本的编码.默认值为utf8. |
21 | - 脚本语言 设置脚本语言. |
免责声明:以上内容(如有图片或视频亦包括在内)有转载其他网站资源,如有侵权请联系删除