即使在成功将selenium软件包安装到pycharm之后也无法运行selenium脚本

时间:2018-05-01 10:52:46

标签: python selenium selenium-webdriver selenium-chromedriver

当我尝试运行以下代码行时,我收到错误。

from selenium import webdriver
browser = webdriver.Chrome("C:\\Users\\Admin\\Downloads\\chromedriver_win32\\chromedriver.exe")


Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\Admin\PycharmProjects\Selenium\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\Admin\PycharmProjects\Selenium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 154, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Users\Admin\PycharmProjects\Selenium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 243, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\Admin\PycharmProjects\Selenium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Admin\PycharmProjects\Selenium\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: chrome failed to start
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86_64)

0 个答案:

没有答案