简体   繁体   English

如何使CasperJS和PhantomJS在优胜美地上正常播放?

[英]How can I get CasperJS and PhantomJS to play nicely on Yosemite?

I've been experiencing some issues getting CasperJS and PhantomJS to work on my Mac Pro running Yosemite and was wondering if anyone had any insights? 我一直在遇到一些问题,无法使CasperJS和PhantomJS在运行优胜美地的Mac Pro上运行,并且想知道是否有人有任何见解?

I've npm'd CasperJS globally and downloaded PhantomJS2 to my drive as per the instructions, but I keep getting errors like: 我已经在全球范围内npm's CasperJS并按照说明将PhantomJS2下载到驱动器中,但是仍然出现类似以下错误:

[1] 9409 killed casperjs test/casper/test.js [1] 9409杀死了casperjs test / casper / test.js

How can I get them to work together? 我如何让他们一起工作?

This is a tricky issue and the solution will involve going round the houses a little bit, but this is what I've found works: 这是一个棘手的问题,解决方案将涉及到绕房子一点,但这是我发现的有效方法:

1) Use the instructions from the CasperJS documentation to clone the repository from GitHub: 1) 使用CasperJS文档中的说明从GitHub复制存储库:

$ git clone git://github.com/n1k0/casperjs.git
$ cd casperjs
$ ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs

2) Download this patched copy Mac copy of PhantomJS from GitHub and unzip it somewhere convenient. 2) 从GitHub下载此补丁副本的PhantomJS Mac副本,并将其解压缩到方便的地方。 I added mine to a folder inside my app test folder as I only need it for that app, but you can put it anywhere. 我在我的应用程序测试文件夹中的文件夹中添加了我的文件夹,因为我只需要该应用程序的文件夹,但是您可以将其放置在任何地方。

3) Export the path of the binary you've just unzipped. 3)导出刚刚解压缩的二进制文件的路径。 In my case it would be something like[1]: 就我而言,它类似于[1]:

export PATH=$PATH:/Users/Andy/Development/app/test/bin

And that should do the trick. 这应该可以解决问题。

[1] solution taken from this SO answer [1] 此SO答案中的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Phantomjs:我怎样才能让Casperjs在我的webapp上工作 - Phantomjs: how can I get Casperjs to work on my webapp 我怎样才能让typeahead.js与jquery.validate完美搭配? - How can I get typeahead.js to play nicely with jquery.validate? 如何获得多个Javascript setInterval函数以在同一页面上很好地一起播放? - How can I get multiple Javascript setInterval functions to play nicely together on the same page? 我可以使用phantomjs / casperjs获取原始页面源(相对于当前DOM)吗? - Can I get the original page source (vs current DOM) with phantomjs/casperjs? 如何让SonarQube与AngularJS很好地配合? - How to get SonarQube to play nicely with AngularJS? casperjs / phantomjs如何单击href =“ javascript:function”并获取结果内容 - casperjs/phantomjs how to click an href=“javascript:function” and get the resulted content 如何使用phantomjs / casperjs处理下载? - How to handle downloads with phantomjs/casperjs? 如何在PhantomJS和CasperJS中设置sessionStorage? - How to set sessionStorage in PhantomJS and CasperJS? 如何获得ready函数和另一个可以在document.ready中正常播放的函数? - How do I get a ready function and another function to play nicely in document.ready? 我如何获取ID到CasperJS中页面上的每个复选框 - How can I get the id to every checkbox on a page in CasperJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM