Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running selenium in c9

I am trying to run a python code that uses selenium module. This code ran perfectly with the use of a chromedriver in my PC. I am trying to run it in c9.io. I downloaded the chromedriver 64 bit version and gave permissions as 777 using chmod. Still I can't get it to work

However, I get the following error:

Traceback (most recent call last):
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 119, in <module>
    op('Aaf')
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 104, in op
    plags=getplags(cd)
  File "/home/ubuntu/workspace/vroniplag/vroni.py", line 92, in getplags
    driver = webdriver.Chrome(chromedriver)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 86, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 99, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service ./chromedriver unexpectedly exited. Status code was: 127

Can anybody tell me how to fix this

like image 806
Echchama Nayak Avatar asked Jan 05 '23 18:01

Echchama Nayak


2 Answers

I encountered the same issue and ran chromedriver --version gave me the exact error.

chromedriver: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

So the problem for me is the missing libraries (that chromedriver requires). So I installed those libraries and fixed the issue:

sudo yum install libX11 Gconf2 fontconfig
like image 175
Tony Vu Avatar answered Jan 11 '23 22:01

Tony Vu


I resolved this on Ubuntu 16.04 with the following:

$ sudo apt install libgconf-2-4
like image 33
Hakan B. Avatar answered Jan 11 '23 22:01

Hakan B.