0

I just started python study and am trying to making a program by copying a youtuber's code line by line.

The code is like this:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()
url = 'https://google.com'
driver.get(url)

driver.find_element_by_css_selector("search-icon").send_keys('banana')

What I tried is to open a google page using chrome and type banana into search icon. but the error message occured

Error message :

File "C:\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Python38\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
from disconnected: unable to send message to renderer
  (Session info: chrome=83.0.4103.97)

I think I have the right version of chrome driver and it is at the same directory with the python code where the python is installed.

Please help.

ppooppoo
  • 13
  • 4
  • Make sure that the web driver executable is in the same directory as the script and you are using the a compatible version of selenium it was made for. – Edison Jun 08 '20 at 22:47
  • Thank you for your answer. I checked the two and they were done correctly – ppooppoo Jun 09 '20 at 14:01

0 Answers0