Python script fails using launchd and Selenium -


i'm trying run simple script using launchd in os x 10.10.5 job fails. think has permissions/privileges not set correctly?

this error code throws up:

traceback (most recent call last): file "/users/john/documents/autorun/opentwitter.py", line 7, in driver = webdriver.firefox() file "/library/python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 64, in init self.service = service(executable_path, firefox_binary=self.options.binary_location) file "/library/python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/firefox/service.py", line 44, in init log_file = open(log_path, "a+") ioerror: [errno 13] permission denied: 'geckodriver.log' exception attributeerror: "'service' object has no attribute 'log_file'" in <bound method service.__del__ of <selenium.webdriver.firefox.service.service object @ 0x10ca6bdd0>> ignored

i printed "start script" in console job.out i've hardcoded script, assume launchd starting script ok, it's running problem selenium/firefox driver? , permissions issue coming play?

it runs fine in ide/run , terminal.

here's test code i'm trying run:

#!/usr/bin/python  selenium import webdriver  print("start script")  driver = webdriver.firefox() driver.get("https://twitter.com/search?q=news&src=typd&lang=en")   print("twitter open, done") 

the p.list follows:

<?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict>     <key>label</key>     <string>johnsjob.job</string>     <key>program</key>     <string>/users/john/documents/autorun/opentwitter.py</string>     <key>standarderrorpath</key>     <string>/tmp/johnsjob.job.err</string>     <key>standardoutpath</key>     <string>/tmp/johnsjob.job.out</string>     <key>startcalendarinterval</key>     <array>         <dict>             <key>hour</key>             <integer>10</integer>             <key>minute</key>             <integer>14</integer>             <key>weekday</key>             <integer>3</integer>         </dict>     </array> </dict> </plist> 

note: change time code run in launchd can test.

i've managed work putting geckodriver in /usr/bin

  1. move file /usr/bin directory: sudo mv chromedriver /usr/bin
  2. goto /usr/bin directory , need run "chmod a+x geckodriver" mark executable.

i think having trouble finding path driver , stopping script dead.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -