0

I opened jupyter notebook on my google cloud cluster with these steps: https://cloud.google.com/dataproc/docs/tutorials/jupyter-notebook Now I get an error on this piece of code:

import selenium  
from contextlib import closing  
from selenium.webdriver import PhantomJS  
with closing(PhantomJS()) as browser:  
     #some further code

I get the following error message:

WebDriverException: Message: 'phantomjs' executable needs to be in PATH.

Now in my own environment when I got this error, I fixed it by adding the path to my phantomjs.exe in my system variables. But now while I am on the google cloud cluster environment, I am looking for another way to add the phantomjs.exe path. Any other solution would be appreciated aswell.

1 Answer 1

0

I have no experience with Selenium or PhantomJS. However since Dataproc runs on Debian 8 Jessie and not Windows, you probably want to run sudo apt-get install phantomjs instead of using an exe. You could either install it manually after SSHing or in an initialization action.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes this was very helpful, I managed to run your codeline in my gcloud shell on my cluster and it downloaded PhantomJS to the cluster. Now I am facing another error (on the same piece of code). 'WebDriverException: Message: Service phantomjs unexpectedly exited. Status code was: -6'. Any ideas?

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.