Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.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
Python 2.7 OSX-ChromeDriver/Selenium Web驱动程序问题_Python 2.7_Selenium_Webdriver_Osx Mavericks - Fatal编程技术网

Python 2.7 OSX-ChromeDriver/Selenium Web驱动程序问题

Python 2.7 OSX-ChromeDriver/Selenium Web驱动程序问题,python-2.7,selenium,webdriver,osx-mavericks,Python 2.7,Selenium,Webdriver,Osx Mavericks,我正在尝试使用找到的资源学习使用Python的SeleniumWebDriver,具体来说,我想使用Chrome。我下载了ChromeDriver,打开它,一个单独的终端窗口弹出——看起来不错。然后,我使用Chrome而不是Firefox启动了文档中的示例测试。然后我得到这个信息- Traceback (most recent call last): File "test1.py", line 7, in <module> driver = webdriver.Chrom

我正在尝试使用找到的资源学习使用Python的SeleniumWebDriver,具体来说,我想使用Chrome。我下载了ChromeDriver,打开它,一个单独的终端窗口弹出——看起来不错。然后,我使用Chrome而不是Firefox启动了文档中的示例测试。然后我得到这个信息-

Traceback (most recent call last):
  File "test1.py", line 7, in <module>
    driver = webdriver.Chrome()
  File "/Library/Python/2.7/site-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/chrome/webdriver.py", line 59, in __init__
self.service.start()
  File "/Library/Python/2.7/site-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/chrome/service.py", line 68, in start
and read up at http://code.google.com/p/selenium/wiki/ChromeDriver")
selenium.common.exceptions.WebDriverException: 
Message: 'ChromeDriver executable needs to be available in the path.
Please download from http://chromedriver.storage.googleapis.com/index.html
and read up at http://code.google.com/p/selenium/wiki/ChromeDriver'

请让我知道,如果我可以提供更多的信息,将有助于你回答我的问题,我真的很想让这个工作。谢谢

你是正确的,你必须将ChromeDriver可执行文件的位置添加到你的路径中——在你的Mac上,它是你的bash_配置文件。这里有一个关于如何添加到路径的链接。
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH"
export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2=$M2_HOME/bin
PATH=$M2:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
PATH=$JAVA_HOME/bin:$PATH
export PATH