Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CLI加载phantomjs或chromium headless中的html并获取任何javascript错误_Javascript_Phantomjs_Command Line Interface_Google Chrome Headless - Fatal编程技术网

CLI加载phantomjs或chromium headless中的html并获取任何javascript错误

CLI加载phantomjs或chromium headless中的html并获取任何javascript错误,javascript,phantomjs,command-line-interface,google-chrome-headless,Javascript,Phantomjs,Command Line Interface,Google Chrome Headless,我有一个自包含的非交互式html工件,我希望通过一个自动化的单一CLI调用方式检查javascript错误,以便它可以与基于java的功能测试集成。我只想将html文件发送到某个无头浏览器,并获得F12控制台中可能出现的任何错误。这最好不涉及服务器。PhantomJS的回调就是为了这个目的。只要想出一个收集错误的脚本,让它将错误写入日志或通过电子邮件发送,然后在需要时从cli运行该脚本

我有一个自包含的非交互式html工件,我希望通过一个自动化的单一CLI调用方式检查javascript错误,以便它可以与基于java的功能测试集成。我只想将html文件发送到某个无头浏览器,并获得F12控制台中可能出现的任何错误。这最好不涉及服务器。

PhantomJS的回调就是为了这个目的。只要想出一个收集错误的脚本,让它将错误写入日志或通过电子邮件发送,然后在需要时从cli运行该脚本