1

I am trying to use Selenium to open a headless Chrome browser in Python. I am using Chrome v84 and tried both Chromedriver v84 and v83. I am on Mac.

import selenium
from selenium import webdriver

path = r"path/to/chromedriver.exe"

op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(executable_path = path, options=op)

I also tried this:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(ChromeDriverManager().install(), options=op)

It returned:

ValueError: There is no such driver by url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282

I also attempted to add Chromedriver to PATH and could check it was there by echo $PATH, but it did not work.

I also tried running brew cask upgrade chromedriver, after installing Chromedriver via homebrew, but it would only install Chromedriver v83 and the update command would only return something like "no updates available".

I also tried adding the path of Chromedriver under /usr/local/bin by running sudo nano /etc/paths in the terminal. Unfortunately, this time it didn't show up when running echo $PATH, and as expected the Python script did not run successfully.

Any help regarding this will be greatly appreciated.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
woxiangqiu
  • 125
  • 1
  • 6

4 Answers4

0

Try '--headless' instead of 'headless' and also '--disable-gpu':

op.add_argument('--headless')

op.add_argument('--disable-gpu')

yrnr
  • 71
  • 6
0

If you are using Chrome v84 check too if the ChromeDriverManager version you are using match. That error is about unmatched versions between driver and python code interface.

integer
  • 221
  • 4
  • 13
  • Thanks for your answer. I’ll go and check the version of ChromeDriverManager and see if I can update it. – woxiangqiu Jul 16 '20 at 13:54
  • Hey, as a follow up, I reinstalled webdrivermanager which I assumed held the latest version of ChromeDriverManager but unfortunately, when running `ChromeDriverManager().install()` it returns saying the link "does not exist", attempting to download version 64 of Chromedriver. Must be an error with webdrivermanager. – woxiangqiu Jul 17 '20 at 03:43
0

This error message...

ValueError: There is no such driver by url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282

...implies that the your program tried to download and install the ChromeDriver from the url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282 which is incorrect.

The correct url is:

https://chromedriver.storage.googleapis.com/LATEST_RELEASE

which returns:

84.0.4147.30

Possibly a bug in


Quick installation of the latest ChromeDriver

To install the latest version of ChromeDriver you can use:

  • Mac users with Homebrew: brew tap homebrew/cask && brew cask install chromedriver
  • Debian based Linux distros: sudo apt-get install chromium-chromedriver
  • Windows users with Chocolatey installed: choco install chromedriver

You can find a detailed iscussion in session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium


tl; dr

However since yesterday (Jul 15, 2020) https://chromedriver.storage.googleapis.com/LATEST_RELEASE returned:

83.0.X

Which was incorrect. @John Chen ensured that we have fixed that now.

Snapshot:

LATEST_RELEASE

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Hi, thanks for your answer. I will definitely try this tomorrow, and follow up. – woxiangqiu Jul 16 '20 at 13:51
  • Hi, I followed your instructions, however, I continued to receive the same error: `selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 84`. Any ideas from here? My Chrome browser is v84. – woxiangqiu Jul 17 '20 at 03:24
0

Hi you need to use exact driver exe accourding web browser version . go to your browser -->about section and check version of chrome then you can download driver.exe in https://chromedriver.chromium.org/downloads this link

(Browser version are updating time to time so you need to update your driver versions)

Justin Lambert
  • 940
  • 1
  • 7
  • 13