I ran the command /usr/bin/chromium-browser
it mentioned installing chromium using snap
When I did that, it threw a new error.
The following is the output of the command snap version.
snap 2.51.1+20.04ubuntu2
snapd unavailable
series -
chromium-browser
Command '/usr/bin/chromium-browser' requires the chromium snap to be installed. Please install it with:
snap install chromium
snap install chromium error: cannot communicate with server: Post http://localhost/v2/snaps/chromium: dial unix /run/snapd.socket: connect: no such file or directory
whereis chromedriver
chromedriver: /usr/bin/chromedriver /usr/local/bin/chromedriver
I ran into all these because I was trying to test out a simple selenium program:
import requests
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome('/usr/bin/chromedriver')
driver.get("https://www.python.org")
print(driver.title)
Which threw the following error:
Traceback (most recent call last):
File "test_ui.py", line 7, in <module>
driver = webdriver.Chrome('/usr/bin/chromedriver')
File "/home/chintu/anaconda3/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "/home/chintu/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/home/chintu/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/chintu/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/chintu/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.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/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)
Not sure if these problems are coming because I am using WSL on windows-10