python - Selenium/PhantomJS raises error -


i'm trying run phantomjs driver in python i'm getting error. i've read should pass whole path argument didn't help.

here code:

from selenium import webdriver  # driver = webdriver.chrome('d:\python_projects\chromedriver_win32/chromedriver.exe') # works driver = webdriver.phantomjs(executable_path='d:\python\phantomjs-2.0.0-windows\bin\phantomjs.exe') 

error:

traceback (most recent call last):   file "path script", line 8, in <module>     driver = webdriver.phantomjs(executable_path='d:\python\phantomjs-2.0.0-windows\bin\phantomjs.exe')   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 75, in start     raise webdriverexception("unable start phantomjs ghostdriver.", e) selenium.common.exceptions.webdriverexception: message: unable start phantomjs ghostdriver. screenshot: available via screen 

do know doing wrong?

make path in raw string, add 'r': 

driver = webdriver.phantomjs(executable_path=r'd:\python\phantomjs-2.0.0-windows\bin\phantomjs.exe') 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -