selenium3.0.1和Python3.5.2运行时出错,求指导

运行代码

from selenium import webdriver

driver = webdriver.Firefox()

driver.get("http://www.126.com")

driver .find_element_by_id ("idInput").clear()

出错


Traceback (most recent call last):

 File "D:\python\126.py", line 3, in

driver = webdriver.Firefox()

File "D:\Program Files\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 145, in __init__

keep_alive=True)

File "D:\Program Files\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__

self.start_session(desired_capabilities, browser_profile)

File "D:\Program Files\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session

response = self.execute(Command.NEW_SESSION, capabilities)

File "D:\Program Files\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute

self.error_handler.check_response(response)

File "D:\Program Files\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, 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

你可能感兴趣的:(selenium3.0.1和Python3.5.2运行时出错,求指导)