Selenium on Google colab

284 views
Skip to first unread message

Pietro

unread,
May 28, 2023, 10:14:22 PM5/28/23
to Selenium Users
Hi, I'm trying to re-work on a old project that I did about 2 years ago.
I'm trying to run selenium chromedriver on google colab, but it's giving me troubles.
Here's my code & error:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.service import Service

driver = webdriver.Chrome(service=Service('/usr/lib/chromium-browser/chromedriver'))
wait = WebDriverWait(driver, 30)


driver.get(url)

--------------------------------------------------------------------------- WebDriverException Traceback (most recent call last) <ipython-input-10-901b80afafcf> in <cell line: 5>() 3 # wait = WebDriverWait(driver, 30) 4 ----> 5 driver = webdriver.Chrome(service=Service('/usr/lib/chromium-browser/chromedriver')) 6 wait = WebDriverWait(driver, 30) 7

3 frames
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py in assert_process_still_running(self) 111 return_code = self.process.poll() 112 if return_code: --> 113 raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}") 114 115 def is_connectable(self) -> bool: WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited. Status code was: 1

What's the problem and how can I fix it?





Reply all
Reply to author
Forward
0 new messages