我试图运行此脚本:PhantomJS硒错误:消息:“phantomjs”可执行文件需要在PATH
https://github.com/Chillee/coursera-dl-all
然而,该脚本在行session = webdriver.PhantomJS()
失败,出现以下错误
Traceback (most recent call last):
File "dl_all.py", line 236, in <module>
session = webdriver.PhantomJS()
File "/home/shaan/.local/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 51, in __init__
self.service.start()
File "/home/shaan/.local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 69, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH.
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service object at 0x7f6f632864d0>> ignored
如何将phantomjs添加到我的PATH中?我运行Ubuntu 16.04并通过npm install selenium
安装硒。
是否安装了phantomjs? –
应该是。有什么方法我可以仔细检查? – quantumbutterfly
做'哪个phantomjs'。如果不在那里,只需将其移动到/ usr/bin或PATH中的任何其他位置 – pguardiario