我正在尝试使用Python here使用Python学习Selenium Webdriver - 具体来说,我想使用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'
但我不知道该怎么做。我找不到任何样子的例子。我根本不是技术,但我认为这是我的bash_profile?如果是这样,现在就是这样,如果它有帮助(我过去曾尝试过使用Java / Maven) -
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
如果我能提供更多可以帮助您回答问题的信息,请告诉我。我真的希望这项工作正常进行。谢谢!