Reputation: 933
I am trying to run a webscraper on a linux server. The full error is below
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 4.4.0-141-generic x86_64)
I have seen similar questions asked on stackoverflow, the solutions are to include the '--headless' and '--no-sandbox' arguments. However, I am already doing this.
I am able run this code locally, however, I am unable to make it work on the server.
I have also checked to see that everything is up to date, and everything is.
ChromeDriver 2.10.267518
selenium 3.141.0
Here is the code snippet where the error occurs.
options.add_argument('--headless')
options.add_argument('--no-sandbox')
caps = DesiredCapabilities.CHROME
caps['loggingPrefs'] = {'performance': 'ALL'}
driver = webdriver.Chrome(options=options, desired_capabilities=caps, executable_path='/usr/local/bin/chromedriver')
I have also tried to run the above code without the executable_path option but I still get the same error.
Upvotes: 3
Views: 1974
Reputation: 933
I was using a config file that was setting the header value to True, so the code was trying to run with a browser and failing. This was a stupid mistake but I'm posting the solution anyway in case it helps someone.
I also had to remove the line below
options.add_argument('--no-sandbox')
and change this line
options.add_argument('--headless')
to
options.add_argument('headless')
Upvotes: 2
Reputation: 193058
This error message...
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 4.4.0-141-generic x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Supports Chrome v33-36
Supports Chrome v71-73
So there is a clear mismatch between the ChromeDriver v2.10 and the Chrome Browser v72.0
@Test
.Upvotes: 1