Thanks Giles. I wonder what I'm doing wrong... I saved the above code to a script SeleniumRoutine.py. Just to double check I print sys.version and selenium.version at the top. The output from running $ python3.7 SeleniumRoutine.py is:
3.7.5 (default, Nov 14 2019, 22:26:37) # sys version
[GCC 5.4.0 20160609]
3.141.0. # Selenium version
Traceback (most recent call last):
File "SeleniumRoutine.py", line 11, in <module>
browser = webdriver.Chrome(options=chrome_options)
File "/home/Kaan191/.local/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "/home/Kaan191/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/home/Kaan191/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/Kaan191/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/Kaan191/.local/lib/python3.7/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.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 5.4.0-1029-aws x86_64)