15
3
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?
Same issues on basic code that once worked, thought I had broke my python structure at first. – Shane – 2013-11-12T08:10:32.837
1
Welp, it looks like phantomjs' dev has admitted that the python bindings are behind. https://github.com/detro/ghostdriver/issues/236 So much for using phantomjs. Wish I would've known that before I spent several ****ing hours trying to wrangle phantomjs to life.
– Amalgovinus – 2013-11-16T04:44:52.9101Same feelings here. Why it is so important to learn code and not libraries unless they are maintained by a large community. You can never expect one guy to maintain his project especially if not making any money off of the hard work. – Shane – 2013-11-16T20:47:53.543