0

I want to use chrome webdriver with python and selenium library; however, I'm having problems opening webdriver in python console. It is finding the path and it opens what it seems to be a browser, also it starts a service listening on port #### but when I do

driver.get('http://www.google.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'driver' is not defined

it doesn't work... here's the error I'm getting when I open a website

here's the output of opening webdriver

 driver = webdriver.Chrome('C:\chromedriver\chromedriver.exe')

DevTools listening on ws://127.0.0.1:52968/devtools/browser/b7b88ebb-e9e1-4726-9d4e-4e3f13990a0a       Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
miatech
  • 2,150
  • 8
  • 41
  • 78
  • Have you checked the incompatibility between chromedriver and chrome. What is the chromedriver version? – Sarvas Mar 15 '20 at 15:40
  • What is the issue, exactly? That error message is as clear as it gets. – AMC Mar 15 '20 at 16:24

1 Answers1

1

You need your chromedriver.exe to match your current chrome browser's version. To check your chrome version go into your chrome settings and select the about chrome tab. You can find your chrome version there. Then download the chromedriver from here that matches your version. Update the path in your code to this driver and it should work.