前提・実現したいこと
seleniumの中でwebdriverにPhantomJSを指定したいです。
・環境
windows7 64bit
python 3.6.5
発生している問題・エラーメッセージ
Warning (from warnings module): File "D:\python64bit\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py", line 49 warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless ' UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead Traceback (most recent call last): File "D:\python64bit\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\python64bit\lib\subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "D:\python64bit\lib\subprocess.py", line 997, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> driver = webdriver.PhantomJS() File "D:\python64bit\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py", line 56, in __init__ self.service.start() File "D:\python64bit\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH.
該当のソースコード
python
1>>> from selenium import webdriver 2>>> driver = webdriver.PhantomJS()
試したこと
phantomjsのpathは通っていると思います。
seleniumのアンインストール、再インストールは試しました。
補足情報(FW/ツールのバージョンなど)
pythonを初めて3日目の超初心者です。
何が分からないかも分からない状態で大変恐縮ですが、ご教授いただける方いらっしゃいましたら何卒よろしくお願いいたします。
phantomjsのpathはどのように通したのでしょうか?そしてなぜ通ってると思いましたか?
あなたの回答
tips
プレビュー