AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Ghost browser selenium python12/27/2023 Phantomjs_path = "C:\Python27\misc\phantomjs-1.9.7-windows\phantomjs.exe"īrowser = webdriver.PhantomJS(executable_path=phantomjs_path, service_log_path=os.vnull) Then I downloaded the phantomjs-1.9.7-windows.zip from here, unzipped it and placed it here: C:\Python27\misc\phantomjs-1.9.7-windows\phantomjs.exeįrom there I had a working Python 2.7/Selenium Webdriver/PhantomJS example for Windows 7. Afterwards I added c:\Python27\Scripts to my PATH.Īfter that fetching the python package selenium was as easy as typing the following into the cmd: pip install selenium After installing Python 2.7.8 and adding c:\Python27 to my PATH I noticed that pip isn't included with Python versions lower than 2.7.9, so I had to add it myself. This may have been a version issue for you, but since I just went through setting this up on my Windows 7 PC without issues I'm going to share my 'journey' here.įirst of, I'm more used to the Mac/Linux Terminal and having the python package manager pip at my disposal is essential to me. This has to be something simple that I'm doing wrong. I also tried: from selenium import webdriver Here's my code: from selenium import webdriverĭriver = webdriver.PhantomJS(executable_path="C:\Python27\misc\phantomjs\phantomjs.exe") WebDriverException: Message: 'Unable to start phantomjs with ghostdriver.' Screenshot: available via screen Start C:\Python27\lib\site-packages\selenium-2.39.0-py2.7.egg\selenium\webdriver\phantomjs\service.py 66 The error I get is: _init_ C:\Python27\lib\site-packages\selenium-2.39.0-py2.7.egg\selenium\webdriver\phantomjs\webdriver.py 50 I also installed Selenium earlier with easy_install. I've installed PhantomJS, added it to my System Variables PATH, and it works properly in the command line. I've read several dozen stackoverflow threads and Google threads. I wouldn't think this would be difficult, but I've been plugging away at this for almost 3 hours now and it's giving me a headache. This is embarrassing to ask because it seems like something with so slim chance of error.
0 Comments
Read More
Leave a Reply. |