- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 04:16 AM
Hello,
I’m programming in a notebook and attempting to use the python library Selenium to automate Chrome/chromedriver. I’ve successfully managed to install selenium using
%sh
pip install seleniumI then attempt the following code, which results in the WebdriverException, copied below.
from selenium import webdriver
driver = webdriver.Chrome()Error:
WebdriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://chromedriver.chromium.org/homeAfter troubleshooting the error, I attempted instead to use webdriver-manager to install the instance of chromedriver as follows, whilst also running it headless.
%sh
pip install webdriver-managerfrom selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument(“—headless”)
driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)This time, I got the following error:
WebdriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/107.0.5304/chromedriver unexpectedly exited. Status code was: 127I’ve roamed the internet for a solution, but no matter what I try, my code ends up throwing one of the two WebDriverException errors above.
Does anybody know how I can get selenium running on DataBricks in order to automate Chrome/chromedriver?
Thanks!