Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PythonAnywhere-';phantomjs.exe';可执行文件需要在路径中_Python_Phantomjs_Pythonanywhere - Fatal编程技术网

PythonAnywhere-';phantomjs.exe';可执行文件需要在路径中

PythonAnywhere-';phantomjs.exe';可执行文件需要在路径中,python,phantomjs,pythonanywhere,Python,Phantomjs,Pythonanywhere,我主持了一个项目与Pythonywhere在线。其中一个文件使用phantomjs来刮取网页(我将phantomjs.exe与所有其他文件一起上传到文件夹中)。当我运行使用phantomjs的文件时,我得到以下错误: selenium.common.exceptions.WebDriverException: Message: 'phantomjs.exe' executable needs to be in PATH. 因此,问题是,我如何将phantomjs.exe添加到PythonAny

我主持了一个项目与Pythonywhere在线。其中一个文件使用phantomjs来刮取网页(我将phantomjs.exe与所有其他文件一起上传到文件夹中)。当我运行使用phantomjs的文件时,我得到以下错误:

selenium.common.exceptions.WebDriverException: Message: 'phantomjs.exe' executable needs to be in PATH.

因此,问题是,我如何将
phantomjs.exe
添加到PythonAnywhere中的
路径

PythonAnywhere dev:不幸的是,phantomjs无法在我们的系统上工作:-(也许可以尝试在Firefox中使用Selenium?

browser=webdriver.phantomjs(“您的路径”)我已经这样做了,但仍然不起作用。所有文件都在一个名为
mm
的文件夹中,因此我将路径设置为
browser=webdriver.PhantomJS('PhantomJS.exe')
请尝试添加完整路径!