PhantomJS () does not work in pyCharm

Hi, I am trying to use PhantomJS () in a pyCharm environment using

from selenium import webdriver
driver = webdriver.PhantomJS()

I also tried

driver = webdriver.PhantomJS(executable_path = "/Path")

But every time he gives me an error:

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

But this works fine in Python 3.6.0 Shell. I also set the var path correctly - "C: \ PhantomJs \ bin \ phantomjs \".

What could be the problem in pyCharm?

+1
source share
1 answer

Ok, I understood the problem. In the executable path, instead of using C: \ PhantomJs \ bin \ phantomjs \ I, C: / PhantomJs / bin / phantomjs / is used. This means that slash reversal solves the problem.

+1
source

Source: https://habr.com/ru/post/1629972/


All Articles