2

I installed selenium on Amazon Linux AMI. I try to use python to activate it. The error show up. I do not know what is supposed to mean. Can chrome webdriver run on that environment.

My code

from selenium import webdriver
driver = webdriver.Chrome("/home/ec2-user/dlfjj/bin/chromedriver")

Error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ec2-user/dlfjj/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
self.service.start()
  File "/home/ec2-user/dlfjj/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 86, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home` 

update: There is new error.

 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ec2-user/dlfjj/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
    self.service.start()
  File "/home/ec2-user/dlfjj/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 96, in start
    self.assert_process_still_running()
  File "/home/ec2-user/dlfjj/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 109, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/ec2-user/dlfjj/bin/chromedriver unexpectedly exited. Status code was: 127

1 Answer 1

7

The error states ...

'chromedriver' executable may have wrong permissions

... which means that it cannot be executed. It should work if you add the execute bit in the EC2 instance

$ chmod +x /home/ec2-user/dlfjj/bin/chromedriver
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.