0

I have selenium 3.6.0 and phantomjs-2.1.1-windows in my Windows 10,and set the PATH to the phantomJS.exe. When I use the code below:

driver = webdriver.PhantomJS(executable_path='') 

I got the fault:

Traceback (most recent call last): File "D:\Python 3.5.4\test\BeautifulSoup.py", line 10, in <module> driver = webdriver.PhantomJS(executable_path='') File "C:\Program Files\Python35\lib\site- packages\selenium\webdriver\phantomjs\webdriver.py", line 52, in __init__ self.service.start() File "C:\Program Files\Python35\lib\site- packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Program Files\Python35\lib\subprocess.py", line 676, in __init__ restore_signals, start_new_session) File "C:\Program Files\Python35\lib\subprocess.py", line 957, in _execute_child startupinfo) OSError: [WinError 87] wrong parameters。 
4
  • Hi, it would help a lot if you could ask a question to get an answer to. This question reads like an answer to another question - "What happens when passing wrong parameters to webdriver.PhantomJS()?". Clarify what you need help with, please. Commented Oct 29, 2017 at 14:24
  • 1
    Sorry, I just want to run through the code. And I know what happens now. Thank you! Commented Oct 29, 2017 at 15:00
  • Not a problem, I am glad that you found what you needed to know :) I tried to convey that questions asked how you asked yours - like providing an answer to a different question - usually does not receive a good answer. Maybe I worded it wrong to convey that message, sorry if I sounded overly harsh. Your own answer does indeed answer what I think your question meant (which was "why am I getting this error?"). Commented Oct 29, 2017 at 15:09
  • Thanks for your concern.:) Commented Oct 30, 2017 at 4:24

1 Answer 1

1

Sorry for disturbing. Actually when I set the phantomJS.exe to the $PATH. I actually do not need any argument in the webdriver.PhantomJS(). I found the doc below: executable_path - path to the executable. If the default is used it assumes the executable is in the $PATH

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.