title: Why crontab can't start the safari driver
body: <p>Last night, I'm trying to use selenium with python to make a script fill the body temperature in the website which given by my college</p>
  <p>But when I want to use crontab to automatically execute the script, it's always report an error like this</p>
  <pre><code>  File &quot;/Users/clay_codes1024/PythonProject/FillTemperature.py&quot;, line 20, in &lt;module&gt;
      driver = webdriver.Safari()
    File &quot;/usr/local/lib/python3.9/site-packages/selenium/webdriver/safari/webdriver.py&quot;, line 57, in __init__
      self.service.start()
    File &quot;/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py&quot;, line 98, in start
      self.assert_process_still_running()
    File &quot;/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py&quot;, line 109, in assert_process_still_running
      raise WebDriverException(
  selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/safaridriver unexpectedly exited. Status code was: 1
  </code></pre>
  <p>here is my Python code</p>
  <pre class="lang-py prettyprint-override"><code>from selenium import webdriver
  import time
  
  account = ''
  password = ''
  temperature = ''
  
  driver = webdriver.Safari()
  
  driver.get('')
  
  driver.find_element_by_id(&quot;username&quot;).send_keys(account)
  
  time.sleep(2)
  
  driver.find_element_by_id(&quot;password&quot;).click()
  
  driver.find_element_by_id(&quot;password&quot;).send_keys(password)
  
  driver.find_element_by_id(&quot;passbutton&quot;).click()
  
  driver.find_element_by_xpath('/html/body/div/div/div/div/div[1]/div[2]/div/form/div[18]/div[1]/div/div[2]/div/div/input').clear()
  time.sleep(2)
  driver.find_element_by_xpath('/html/body/div/div/div/div/div[1]/div[2]/div/form/div[18]/div[1]/div/div[2]/div/div/input').send_keys(temperature)
  time.sleep(2)
  
  # use javascript to click the log in button
  js = 'document.getElementById(&quot;post&quot;).click();'
  driver.execute_script(js)
  time.sleep(5)
  
  driver.quit()
  </code></pre>
  <p>what I have done:</p>
  <pre><code>1. Give the full disk access to Python3, crontab, terminal
  
  2. Use shell script to execute the python script like this
  echo 'password' | sudo -S /usr/local/bin/python3 /Users/clay_codes1024/PythonProject/FillTemperature.py
  
  3. Turn on the 'Allow remote automation' in safari
  </code></pre>
  <p>All above didn't work!</p>
  <p>So pls help me</p>
  <p>Huge thanks!!!!!!</p>