http://stackoverflow.com/questions/13287490/is-there-a-way-to-u
Is there a way to use PhantomJS in Python?
被顶次数最多的回答竟然是这个
The easiest way to use PhantomJS in python is via Selenium. The simplest
installation method is
1. Install NodeJS
2. Using Node's package manager install phantomjs: npm -g install phantomjs
3. install selenium (in your virtualenv, if you are using that)
Python -> selenium -> phantomjs webdriver -> Node.js
为什么这链条这么长?
c********l 发帖数: 8138
2
https://www.npmjs.org/package/phantomjs
A Note on PhantomJS
PhantomJS is not a library for NodeJS. It's a separate environment and code
written for node is unlikely to be compatible. In particular PhantomJS does
not expose a Common JS package loader.
This is an NPM wrapper and can be used to conveniently make Phantom
available It is not a Node JS wrapper.
既然是standalone的,为什么还需要事先装node.js再装phantom.js?