2

Afeter reinstalling Python I get the following error:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception: Missing or invalid capabilities
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 5.19.0-46-generic x86_64)

My chrome was updated recently. Version 114.0.5735.133 (Official B Ubunuild) (64-bit). I just downloaded the lastest version of chromedriver from the official site link and put it into the home folder after extracting. My OS is Ubuntu 22 My initial program code:

from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
import os
from datetime import datetime
import random
import schedule

options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options) 

the line that originates the error is:

driver = webdriver.Chrome(options=options)

Path export in my shell config (.zshrc):

export PATH="/home/user/chromedriver_linux64/chromedriver:$PATH"
Eric
  • 101
  • 9

1 Answers1

0

Though you mentioned about downloading ChromeDriver from the official site link containing ChromeDriver 114.0 but this error message...

selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception: Missing or invalid capabilities
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 5.19.0-46-generic x86_64)

...implies that chromedriver=2.29.461571 was effectively in use.


Solution

Ensure that instead of chromedriver=2.29.461571, chromedriver=114.0 is used.

Note: You may need to change the Path variable in your shell config (.zshrc):

export PATH="/home/user/chromedriver_linux64/chromedriver:$PATH"
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352