I'm trying to run Selenium with chrome
I tested this question: WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome
But it generates the error: cannot find Chrome binary
I tested this issue: Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed
But it generates the error: Chrome has crashed
Machine: Ubuntu 16 & Python 3.4
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.binary_location = "/usr/local/bin/chromedriver"
options.add_argument("--start-maximized")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options, executable_path=r'/usr/local/bin/chromedriver')
driver.get('http://google.com/')
output
Traceback (most recent call last):
File "testdrive.py", line 11, in <module>
driver = webdriver.Chrome(options=options, executable_path=r'/usr/local/bin/chromedriver')
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.4/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/local/bin/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Can someone help me?