1

I have a python script that does some things online. Every 10 seconds launchd (OSX 10.11.3 El Capitan) launches a shell script, which calls the python script, which goes online using selenium webdriver.PhantomJS() (or should).

When running the shell script from the terminal, everything succeeds. When running in the configuration described above but with webdriver.Firefox() instead of webdriver.PhantomJS(), everything succeeds. However, when running through launchd -> shell -> python with webdriver.PhantomJS(), it exits with abnormal code: 1.

A simplified version of my code (with all the imports):

from selenium import webdriver
import selenium.webdriver.support.ui as ui
from selenium.common.exceptions import  NoSuchElementException
d = webdriver.PhantomJS()
d.close()

What am I missing? I would suspect full path names, but I do not explicitly import Firefox() either, and that does work...

1
  • I have the same issue. I can't even get past the line loading PhantomJS. :( Commented Aug 28, 2016 at 15:05

1 Answer 1

0

Is it failing on an import failure? I had a similar-sounding problem, outlined here: Running Python Script with Launchd: imports not found

What was helpful: using LaunchControl, capturing Standard Error, and finding out python could not import a specific package. Not sure if that's your problem, but Standard Error will tell you what abnormal code: 1 actually is.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.