I am having issues with selenium and webdriver_manager. This script works on my local machine but when I run it on a Linux(ubuntu) server it errors out. It has a problem with:..
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
Any ideas how to solve this?
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get('http://python.org')
print(driver.title)
I am getting the following error
====== WebDriver manager ======
Current google-chrome version is 101.0.4951
Get LATEST chromedriver version for 101.0.4951 google-chrome
Trying to download new driver from https://chromedriver.storage.googleapis.com/101.0.4951.41/chromedriver_linux64.zip
Driver has been saved in cache [/root/.wdm/drivers/chromedriver/linux64/101.0.4951.41]
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
Input In [1], in <cell line: 4>()
2 from selenium.webdriver.chrome.service import Service
3 from webdriver_manager.chrome import ChromeDriverManager
----> 4 driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
Also gives me this error.
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)