I'm trying to get Selenium to use phantomjs on a Windows machine. My code compiles without any error:
from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import cookielib import re from splinter import Browser driver = webdriver.PhantomJS('C:/Program Files (x86)/phantomjs-1.9.2-windows')
But every single time I run it I get the error
Traceback (most recent call last): File "E:/~PROJECT/disinfo/py/bs.py", line 8, in <module> driver = webdriver.PhantomJS('C:/Program Files (x86)/phantomjs-1.9.2-windows') File "C:\Python27\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py", line 50, in __init__ self.service.start() File "C:\Python27\lib\site-packages\selenium\webdriver\phantomjs\service.py", line 63, in start raise WebDriverException("Unable to start phantomjs with ghostdriver.", e) selenium.common.exceptions.WebDriverException: Message: 'Unable to start phantomjs with ghostdriver.' ; Screenshot: available via screen
I've been getting this error for hours. "Unable to start phantomjs with ghostdriver". The simplest examples online show installing selenium with PIP and then phantomjs with NodeJS NPM, which is how I did it. Selenium's location is in my PYTHONPATH as well. I frankly have no idea what the hell this thing wants from me. Any ideas?