romain jouin romain jouin - 18 days ago 14
Python Question

Struggling with web chromedriver

I had a working selenium notebook, which I didn't use for three weeks, and now crash :-(

It seems I am not alone :
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1548

I understand that Chrome change of version, going to version 54 recently, and making old selenium's version crashing.

Following several blogs I finally downloaded webdriver again :
https://sites.google.com/a/chromium.org/chromedriver/

And following opera driver (yes, I also tried opera :-/ )
https://github.com/operasoftware/operachromiumdriver/blob/master/examples/desktop.py

I still had the issue.

So here is the log :

from selenium import webdriver
from selenium.webdriver.chrome import service

webdriver_service = service.Service('/Users/romain/anaconda/bin/chromedriver_bug')
webdriver_service.start()

driver = webdriver.Remote(webdriver_service.service_url, webdriver.DesiredCapabilities.OPERA)


giving :

driver.get('https://www.google.com/')
WebDriverException: Message: session not created exception
from unknown error: bad inspector message: {"method":"Page.loadEventFired","params":{"timestamp":88165,388799}}
(Session info: chrome=54.0.2840.87)
(Driver info: chromedriver=2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1),platform=Mac OS X 10.12.0 x86_64)


How am I supposed to change webdriver ? I just copy-pasted the unziped file into ~/Anaconda/bin/webdriver.
Is that the correct way ?

EDIT ==================

I did :

$ pip install -U selenium
Requirement already up-to-date: selenium in /Users/romain/anaconda/lib/python2.7/site-packages


I downloaded Chrome Driver from : https://chromedriver.storage.googleapis.com/index.html?path=2.25/

I unpacked the [
chromedriver_mac64 (1).zip
] and get the [
chromedriver
] file which I placed below [
~/anaconda/bin
].

I have :

$ which jupyter
~/anaconda/bin/jupyter


I did :

from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.google.com/')


And I get a blocked program, with an opened windows, and no url fetch :
enter image description here

The same if I do :

from selenium import webdriver
from selenium.webdriver.chrome import service
webdriver_service = service.Service('/Users/romain/anaconda/bin/chromedriver')
webdriver_service.start()
driver = webdriver.Remote(webdriver_service.service_url, webdriver.DesiredCapabilities.OPERA)
driver.get('https://www.google.com/')


I get :
enter image description here

Answer

I looked at :

https://bugs.chromium.org/p/chromedriver/issues/detail?id=1552

and set :

LC_NUMERIC=”en_US.UTF-8″
LANG=”en_US.UTF-8″

in my ~/.bash_profile

then it worked :-)

Comments