0

I've been running this in collab without a trouble until just today. No changes was made to the code, however the error just appear today. The error shown:

Message: Service chromedriver unexpectedly exited. Status code was: -6

My code is as follow

# install chromium, its driver, and selenium
!apt-get update
!apt install chromium-chromedriver
!cp /usr/lib/chromium-browser/chromedriver /usr/bin
!pip install selenium-wire
# set options to be headless, ..
from seleniumwire import webdriver
options = webdriver.ChromeOptions()
options.set_capability(
                        "goog:loggingPrefs", {"performance": "ALL", "browser": "ALL"}
                    )
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# open it, go to a website, and get results
driver = webdriver.Chrome('chromedriver',options=options)

driver.get('url')

Please do help . Thank you.

Hal
  • 193
  • 1
  • 9
  • Did you check whether the chrome driver and selenium versions are compatible? Also, another possible reason is that the chromedriver binary is not in the PATH, then you have to copy the binary file to /usr/bin. Also, consider adding a delay before the driver.get('url') line or also, try to wrap the driver.get() call in a try-except block to catch any errors that may occur. – Hasidul Islam Jan 19 '23 at 06:29
  • compatibility should be handled by the update and the path is also handed by cp usr/bin. What do you mean delay before the driver get url line? Try and except has been done that's why I can get the error message above. – Hal Jan 19 '23 at 06:56
  • 1
    That's a dublicate to https://stackoverflow.com/questions/75155063/selenium-use-chrome-on-colab-got-unexpectedly-exited Solution is allready provided tho. – kaliiiiiiiii Jan 19 '23 at 07:28
  • hi i tried using ctrl+shift+p in colab and can't find the Use Fallback Runtime Version, I am also figuring out how to get the debian.list and chromium.pref . Is this run on vsc? Please do help as I am running it on colab. – Hal Jan 20 '23 at 01:25

0 Answers0