📜  PhantomJS-命令行界面

📅  最后修改于: 2020-10-21 05:38:00             🧑  作者: Mango


可以使用关键字“ phantomjs”和文件名来执行PhantomJS。例如,“ phantomjs file.js”。

您还可以将参数传递到“ file.js”,如下所示:

phantomjs [options] file.js arg1 arg2 ...

让我们来看一下命令行中可用的一些选项。

S.No Option & Description
1

–help or –h

Will display all the command line options. Halts immediately and will not run the script passed.

2

–version or –v

Prints the version of PhantomJS running. This will halt the execution of script to be run.

3

–debug[true|false]

Prints warnings and debug messages. By default, it is set to false. You can also use [yes|no].

4

–cookies-file = /path/to/cookies.txt

File name to store persistent cookies.

5

–diskcache=[true|false]

Enables disk cache. It also takes values [yes|no]

6

–disk-cahe-path

Path for disk cache.

7

–ignore-sslerrors=[true|false]

Ignore SSL errors. For example – Expired or self-signed certificate errors. Default is false. It also takes values [yes|no].

8

–loadimages=[true|false]

Loads all inline images. Default value is true. It also takes [yes|no].

9

–local-storagepath=/some/path

Path to save LocalStorage content and WebSQL content.

10

–local-storagequota=number

Maximum size to allow for data.

11

–local-url-access

Allows use of ‘file:///’ URLs (default is true).

12

–local-to-remote-urlaccess=[true|false]

Allows local content to access remote URL. Default is false. It also takes values [yes|no].

13

–max-disk-cachesize=size

Limits the size of disk cache (in KB)

14

–offline-storage-path

Specifies location for offline storage.

15

–offline-storage-quota

Sets the maximum size of the offline storage in KB.

16

–outputencoding=encoding

Sets the encoding used for terminal output. Default is utf-8.

17

–proxy=address:port

Specifies the proxy server to be used (For example – proxy=192.168.1.1:8080)

18

–proxytype=[http|socks5|none]

Specifies the type of proxy server (default is http)

19

–proxy-auth

Authentication information for the proxy. For example –

–proxy-auth=username:password

20

–scriptencoding=encoding

Sets the encoding used for the script. Default is utf8.

21

–script-language

Sets the script language.