简体   繁体   English

如果没有页面,可以使用PhantomJS函数

[英]Can PhantomJS function if there is not page opeend

Will phantomjs close itself if there is no page opened on it? 如果没有打开页面,phantomjs会自行关闭吗? I have one really weird scenario, because I am running tests in tabs/pages and when tests are finished I close tab/page, and it looks like, as if there is no page opened, phantomjs kills it self. 我有一个非常奇怪的场景,因为我正在选项卡/页面中运行测试,并且在测试完成时关闭了选项卡/页面,看起来好像没有打开任何页面,phantomjs会自行杀死它。

Is that possible? 那可能吗?

PhantomJS exits either when you call phantom.exit() or an uncaught error happens. 当您调用phantom.exit()或发生未捕获的错误时,PhantomJS退出。 When no page is open, it will run indefinitely. 当没有页面打开时,它将无限期运行。 Otherwise, it couldn't be used as a web server through its web server module . 否则,它不能通过其Web服务器模块用作Web服务器

PhantomJS can run in just the console with no other browser running. PhantomJS可以仅在控制台中运行,而无需运行其他浏览器。 This makes it ideal for CI systems and background processes. 这使其成为CI系统和后台过程的理想选择。

Checkout: http://phantomjs.org/headless-testing.html 结帐: http : //phantomjs.org/headless-testing.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM