3

OS : UBUNTU 20.04 LTS Google chrome -Version 86.0.4240.183 (Official Build) (64-bit) conda: 4.9.1 Selenium: 3.141.0

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--disable-infobars')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--no-sandbox')
options.add_argument('--remote-debugging-port=9222')
    driver =webdriver.Chrome(executable_path='/home/blank/Downloads/useless/chromedriver_linux64 (3)/chromedriver',options=options)`

It was working a day before i dont know whats the problem .

SessionNotCreatedException: Message: session not created exception from disconnected: Unable to receive message from renderer (Session info: chrome=86.0.4240.183) (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 5.4.0-52-generic x86_64)

devansh
  • 89
  • 2
  • 8
  • I got the solution by help of a friend . !pip install webdriver_manager from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) – devansh Nov 16 '20 at 12:49
  • I had to remove `options.add_argument('--remote-debugging-port=9222')` in my case. Not sure why, maybe it's deprecated or something? – thorie Aug 04 '21 at 16:38

1 Answers1

2

This mean your chrome driver is unable to initiate/spawn a new Chrome Browser. It might happen due to many reason so i not 100% sure but this is things i usually do:

  1. Re-check chrome driver, jdk and selenium version, make sure it compatibility with Chrome Browser on your computer

  2. Ensure that /etc/hosts on your system contains the following entry (if using mac or linux):

127.0.0.1 localhost.localdomain localhost #or 127.0.0.1 localhost loopback

  1. Turn off antivirus (some can affect chrome driver)

  2. clear all data and reboot system.

Trinh Phat
  • 524
  • 3
  • 6
  • 1
    The versions are compatible with each other and updated . I am not sure what u mean by /etc/hosts . Please elaborate on the method . I have also uninstalled each application and reinstalled again , even tried to use Firefox but same error is encountered . – devansh Nov 08 '20 at 15:11