Здравствуйте!
Пытаюсь завести скрипт (cgi-bin) python на сервере (макхост, виртуальный хостинг). Код скрипта:
#!/usr/bin/python3.5
import os
import sys
import codecs
sys.stdout = codecs.getwriter('cp1251')(sys.stdout.detach())
sys.path.append('/home/httpd/vhosts/my_domain.ru/private/lib/python3.5/site-packages')
from selenium import webdriver
print('Content-type: text/html\r\n\r\n')
os.environ['MOZ_HEADLESS'] = '1'
driver = webdriver.Firefox(executable_path='/home/httpd/vhosts/my_domain.ru/private/geckodriver.exe')
driver.get('https://vk.com')
Однако, не работает. Traceback:
Traceback (most recent call last):
File "telephone.py", line 17, in <module>
driver = webdriver.Firefox(executable_path='/home/httpd/vhosts/my_domain.ru/private/geckodriver.exe')
File "/home/httpd/vhosts/my_domain.ru/private/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 148, in __init__
self.service.start()
File "/home/httpd/vhosts/my_domain.ru/private/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/home/httpd/vhosts/my_domain.ru/private/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/httpd/vhosts/my_domain.ru/private/geckodriver.exe unexpectedly exited. Status code was: -4
Не могу понять, почему так. Предполагаю, что просто не установлен firefox.