我遇到了问题,能否指点我正确的方向?如何在Windows 7上安装Zombie JS? (node.js无头浏览器)
编辑:这个模块(Contextify)不会从Windows上的npm安装。有关更多信息,请参阅https://github.com/brianmcd/contextify/issues/10。
这是因为故宫不支持C++模块在Windows上尚未:https://github.com/brianmcd/contextify/issues/14#issuecomment-3577972
一般来说,我想运行http://zombie.labnotes.org - 适用于Windows,他们所提出的建议:
在Windows上,你需要的Cygwin以访问GCC,Python等阅读 本作的详细说明和故障排除:https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)
的问题是 - 他们说的Cygwin描述已过时,并建议使用Visual Studio ...无论哪种方式,我得到了两个,我通过使用nodejs安装程序,而不是从头开始构建它(错误似乎并不相关)。这里是我做的步骤:使用安装程序
1)安装的node.js:http://nodejs.org/#download
2)得到NPM包管理器:https://github.com/isaacs/npm
3)得到的Python 2.7,Visual Studio 2010中(一些来源的指示的C++编译器根据需要)和Cygwin ...
4)由于安装在contextify失败我搜索it
使用预制的二进制刚才下载的ZIP文件在 https://github.com/Benvie/contextify/zipball/master,将其解压缩到 你node_modules文件夹,然后重命名文件夹“contextify”
c:\Program Files (x86)\nodejs>node --version
v0.6.13
c:\Program Files (x86)\nodejs>npm install zombie
npm http GET https://registry.npmjs.org/zombie
npm http 304 https://registry.npmjs.org/zombie
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/jsdom/0.2.10
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/jsdom/0.2.10
npm http 304 https://registry.npmjs.org/coffee-script
> [email protected] preinstall c:\Program Files (x86)\nodejs\node_modules\zombie\node_mo
dules\ws
> make
1 file(s) copied.
1 file(s) copied.
npm http GET https://registry.npmjs.org/commander/0.5.0
npm http GET https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/commander/0.5.0
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/cssom
> [email protected] preinstall c:\Program Files (x86)\nodejs\node_modules\zombie\
node_modules\jsdom\node_modules\contextify
> node-waf clean || (exit 0); node-waf configure build
node-waf was unexpected at this time.
npm ERR! Error: ENOENT, chmod 'c:\Program Files (x86)\nodejs\node_modules\zombie
\node_modules\jsdom\node_modules\request\tests\squid.conf'
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "zombie"
npm ERR! cwd c:\Program Files (x86)\nodejs
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! path c:\Program Files (x86)\nodejs\node_modules\zombie\node_modules\jsd
om\node_modules\request\tests\squid.conf
npm ERR! fstream_path c:\Program Files (x86)\nodejs\node_modules\zombie\node_mod
ules\jsdom\node_modules\request\tests\squid.conf
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! message ENOENT, chmod 'c:\Program Files (x86)\nodejs\node_modules\zombi
e\node_modules\jsdom\node_modules\request\tests\squid.conf'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_mod
ules\npm\node_modules\fstream\lib\writer.js:285:17)
npm ERR! Error: ENOENT, lstat 'c:\Program Files (x86)\nodejs\node_modules\zombie
\node_modules\jsdom\node_modules\htmlparser\runtests.html'
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "zombie"
npm ERR! cwd c:\Program Files (x86)\nodejs
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! path c:\Program Files (x86)\nodejs\node_modules\zombie\node_modules\jsd
om\node_modules\htmlparser\runtests.html
npm ERR! fstream_path c:\Program Files (x86)\nodejs\node_modules\zombie\node_mod
ules\jsdom\node_modules\htmlparser\runtests.html
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, lstat 'c:\Program Files (x86)\nodejs\node_modules\zombi
e\node_modules\jsdom\node_modules\htmlparser\runtests.html'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_mod
ules\npm\node_modules\fstream\lib\writer.js:204:26)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\Program Files (x86)\nodejs\npm-debug.log
npm not ok
c:\Program Files (x86)\nodejs>
什么步骤,我需要做的为了使其运作?
如果建设从源到的NodeJS安装需要一个包,那么请大声说出来:)
感谢您的帮助!
如果我需要支持cookie? http://stackoverflow.com/questions/9504765/does-phantomjs-support-cookies (我将运行Ubuntu然后) – 2012-03-24 15:23:30
它可以正常使用Cookies。 PhantomJS脚本本身无法访问Cookie。即您在PhantomJS中打开的任何网页都可以正常使用Cookie,而不是您的PhantomJS脚本。 – 2012-03-24 15:34:50
好了,那就试试看吧。我担心我甚至无法接受cookie:http://code.google.com/p/phantomjs/issues/detail?id=91感谢您的帮助! – 2012-03-24 15:37:28