I use selenium + python. I installed selenium in python via pip and wrote this code:

from selenium import webdriver driver=webdriver.Chrome("E:\drivers\chromedriver.exe") 

When running in Pycharm, the following error log appears:

 Traceback (most recent call last): File"C:/Users/user/PycharmProjects/untitled/bot.py", line 3, in <module> driver=webdriver.Chrome("E:\drivers\chromedriver.exe") AttributeError: module 'selenium.webdriver' has no attribute 'Chrome' 

And when running through IDLE:

 Traceback (most recent call last): File "C:\Users\user\PycharmProjects\untitled\bot.py", line 3, in <module> driver=webdriver.Chrome("E:\drivers\chromedriver.exe") File "E:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__desired_capabilities=desired_capabilities) File "E:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 154, in __init__self.start_session(desired_capabilities, browser_profile) File "E:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 243, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "E:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute self.error_handler.check_response(response) File "E:\python\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.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.3.9600 x86_64)` 

Python version 3.6.4 is used.

  • to launch Chrome, in addition to chromedriver, you need to have a Google Chrome browser on the system, do you have it? - Milkiweed Gtlt
  • yes, chrome is installed - flexo223
  • Download the version Chromedriver 2.37 and try not to run through pycharm, but through the terminal - Sasha Koroviy

1 answer 1

You need to add seleneium in the settings of the venv Project Interpreter Selenium. Ctrl + Alt + S and add it to the list. Screen with settings