python phanthomjs无法与nohup一起使用 [英] python phanthomjs is not working with nohup

查看:85
本文介绍了python phanthomjs无法与nohup一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phanthomjs运行selenium,如果我按以下方式触发脚本,则脚本可以完美运行:

I'm running selenium using phanthomjs, the script is running perfectly if when I trigger it as:

python my_script.py 

但是当我尝试使用nohup时:

But when I try to using nohup:

nohup python my_script.py &

我遇到以下错误:

selenium.common.exceptions.WebDriverException: Message: Service phantomjs unexpectedly exited. Status code was: 8

推荐答案

指定参数对我有效:

driver = webdriver.PhantomJS(executable_path = '/usr/lib/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs')

这篇关于python phanthomjs无法与nohup一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆