9

Here's my code for opening Chrome:

from selenium import webdriver 
driver=webdriver.Chrome('C:\\Users\\Imran\\AppData\\Local\\Programs\\Python\\Python36\\selenium\\chromedriver.exe')

Error when running program:

Traceback (most recent call last):
  File "C:/Users/Imran/PycharmProjects/webscraping/WF Item.py", line 6, in <module>
    driver = webdriver.Chrome('C:\\Users\\Imran\\AppData\\Local\\Programs\\Python\\Python36\\selenium\\chromedriver.exe')
  File "C:\Users\Imran\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\Imran\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Users\Imran\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Users\Imran\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Imran\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"27028.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=54.0.2840.71)
  (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.3.9600 x86_64)

Getting the following exception:

selenium.common.exceptions.WebDriverException: Message: session not created exception
2
  • Did you find a solution ? Commented Nov 4, 2016 at 15:06
  • @Romain Jouin Please download update version of chromedriver Commented Aug 8, 2019 at 5:42

3 Answers 3

19

Update your chromedriver to 2.24 version from the given url:

http://chromedriver.storage.googleapis.com/index.html?path=2.24/

That worked for me.

Sign up to request clarification or add additional context in comments.

2 Comments

I can't really understand how do we update chromedriver ? I have a [chromedriver] in [ ~/anaconda/bin ] => should I download, unzip and replace the [chromedriver] file with the newly unzipped [chromedriver] file ?
I'm using apt-get way for installing/updating on my linux sysyem
3

Setting LANG=en_US.UTF-8 before executing my script works for me. See this: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1552#c43

In Python:

import os
os.environ["LANG"] = "en_US.UTF-8"

Comments

1

To install the chromedriver on windows, download and unzip the chromedriver_win32.zip and add the path to the folder containing the chromedriver.exe in the environment variables setting [System properties - Advanced system settings - Environment variables].

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.