Report this

What is the reason for this report?

Can't open webdriver selenium easy in digital ocean server

Posted on January 10, 2019

easy code not work selenium

#!/usr/bin/python
# This Python file uses the following encoding: utf-8

import time
import random
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options 
from pyvirtualdisplay import Display


driver = webdriver.Chrome(executable_path='/usr/bin/chromedriver')

link = "https://google.com"
driver.get(link)
driver.save_screenshot('/var/chromedriver/headless_chrome_test.png') 
driver.quit()

have mistake console


Traceback (most recent call last):
  File "follow.py", line 27, in <module>
    driver = webdriver.Chrome(executable_path='/usr/bin/chromedriver')
  File "/var/venv/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/var/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/var/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/var/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/var/venv/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.9.248304,platform=Linux 4.4.0-140-generic x86_64)



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey friend,

I found another person who experienced a similar error, and someone offered an answer that appeared to work for them:

https://stackoverflow.com/questions/47596402/selenium-chrome-failed-to-start-exited-abnormally-error

Jarland

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.