gpt4 book ai didi

grails - 从Grails服务中调用phantom.js

转载 作者:行者123 更新时间:2023-12-02 14:17:13 24 4
gpt4 key购买 nike

我需要从grails服务中调用phantom.js脚本,以创建可以缓存的PNG图片。

我在phantom和grails上看到的所有示例都涉及使用phantom进行测试,因此我不确定应如何从服务中对其进行管理。

从grails服务调用脚本时最好的实践是什么?

它使用自定义脚本基于传入的url创建图像。

这将是命令行上的等价物:

./phantomjs createImage.js http://www.toBeConcerted.com output.png

最佳答案

这与从Java或Groovy调用可执行文件相同。
Groovy文档为此主题提供了a specific page。您还可以检查this related SO question
Groovy示例

def command = """phantomjs createImage.js http://www.toBeConcerted.com output.png"""// Create the String
def proc = command.execute() // Call *execute* on the string
proc.waitFor() // Wait for the command to finish

关于grails - 从Grails服务中调用phantom.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17806913/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com