Introduction
I use PhantonJS Driver for screenscraping. The pages that are loaded contain JavaScript which loads the HTML. PhantomJS will render the pages in HTML.I downloaded PhantomJS from their Download page. When I tried to put it into my /usr/bin directory so it would be on my path, I got the following error message.
Error Message:
cp ~/Tools/phantomjs-2.1.1-macosx/bin/phantomjs /usr/bin/
cp: /usr/bin/phantomjs: Operation not permitted
How I got around this Error
I have a ~/Tools directory that I use for these development tools. I used the ~/.bash_profile file to add it to the $PATH.- Unzip PhantomJS into the ~/Tools directory.
- Add the location of phantomjs to the $PATH via the ~/.bash_profile.
- vim ~/.bash_profile
- export PATH=$PATH:~/Tools/phantomjs-2.1.1-macosx/bin
- source ~/.bash_profile
- Test if it is added to your CLI by executing `phantomjs`, to exit `Ctrl+C`.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.