|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
求助!在MAC上安装了pycharm,也安装了selenium3.5 在执行
from selenium import webdriver
import time
dr = webdriver.Firefox()
dr.get('http://baidu.com')
time.sleep(5)
print 'Broswer will be closed'
dr.quit()
print 'Broswer is close'
这段代码的时候,连续碰雷
- /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/chewenting/PycharmProjects/test/test-pip.py
- Traceback (most recent call last):
- File "/Users/chewenting/PycharmProjects/test/test-pip.py", line 3, in <module>
- dr = webdriver.Firefox()
- File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 154, in __init__
- keep_alive=True)
- File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 140, in __init__
- self.start_session(desired_capabilities, browser_profile)
- File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 229, in start_session
- response = self.execute(Command.NEW_SESSION, parameters)
- File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 297, in execute
- self.error_handler.check_response(response)
- File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
- raise exception_class(message, screen, stacktrace)
- selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
- Process finished with exit code 1
复制代码
求大神解答,要哭了! |
|