5
私は、SELinuxとphantomjs webdriverを使用するLinuxサーバーでpythonスクリプトを実行しようとしています。パス上のファイルを呼び出すpythonとseleniumを使用してphantomJs webdriverに接続する際に問題が発生しました。
import selenium
from selenium import webdriver
driver = webdriver.PhantomJS(executable_path='/home/ubuntu/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs')
、返します:ここで
selenium.common.exceptions.WebDriverException: Message: Service /home/ubuntu/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs unexpectedly exited. Status code was: 127
が失敗し、このエラーを生成する単純なテストスクリプトである:しかし、私は次のようなエラーメッセージが出続ける
file /home/ubuntu/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
/home/ubuntu/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=d0f2a21ff9e0b82113a2095e7cbca7dceaba88fb, stripped
このスクリプトをどのように起動して実行することができますか?私は同様のstackoverflowの質問であると思われるものを読んで、npm経由でファントムを再インストールし、sudoでスクリプトを実行するなどの提案されたソリューションを適用しようとしましたが、運がなかった。これ以上情報を提供できない場合は、私に知らせてください。