0
votes

Windows7, selenium 2.45.0, python 2.7.5, phantomjs 2.0.0

Installed selenium with pip (seems to be working fine otherwise), installed phantomjs from http://phantomjs.org/download.html. Moved the folder for phantomjs into a folder within C:\Python27 and then added C:\Python27...\bin\phantomjs to system Path (tried both phantomjs and phantonjs.exe). Whenever driver = webdriver.PhantomJS() is used this occurs...

Error:

raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
WebDriverException: Message: Unable to start phantomjs with ghostdriver.
Screenshot: available via screen

Tried every solution I could find so far: reverting to version 2.37.0, trying phantomjs vs phantomjs.exe in path, altering the service.py file, installing it through node.js, rebooting after adding it to path, and using executable_path=.... within the PhantomJS() parameter. Any additional ideas?

1

1 Answers

-1
votes

PhantomJS recently dropped Python support altogether. However, PhantomJS now embeds Ghost Driver.

A new project has since stepped up to fill the void: Ghost.py (http://jeanphix.me/Ghost.py/). You probably want to use that instead:

from ghost import Ghost
ghost = Ghost()
page, extra_resources = ghost.open("http://jeanphi.fr")
assert page.http_status==200 and 'jeanphix' in ghost.content