phantomjs

How to use ES6 with PhantomJS

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to use ES6 and modules with PhantomJS? I can transpile each file from ES6 to ES5 using Babel, but it's awkward to maintain parallel trees (one in ES6 and another in ES5) and write the imports to require the ES5 modules. I'm looking for a cleaner solution. I can remove all import and export code, concatenate the modules together, transpile the result into a single file, then run in through PhantomJS, but I'd prefer to use imports and exports if possible. I tried using Browserify with the babelify transform to transpile the ES6

php execution phantom js works but casperjs does not work permission denied

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: okay so i am running centos 6.5 with zpanel setup. this then has phantom js and casperjs both setup and working it the /usr/local/bin directory. i use this php command for phantomjs and casperjs echo exec('/usr/local/bin/casperjs --version 2>&1'); phantomjs works fine but casperjs gives me this error sh: /usr/local/bin/casperjs: Permission denied can anyone out there help me fix this problem it is just a pain output for ls -al casperjs [root@cyber-hosted ~]# ls -al casperjs total 100 drwxr-xr-x 10 apache root 4096 Feb 4 15:49 . dr-xr-x---. 5

Can't find variable - PhantomJS

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I post here after many hours of fruitless searching. PhantomJS does not allow me to use a variable as in the code below, with the error message when running my script "Can not find variable". Do you have any idea where can be my problem? page . open ( myurl , function ( status ) { if ( status == 'success' ) { page . includeJs ( "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" , function () { elem = page . evaluate ( function () { /* Select one element with jQuery */ myElem = $ ( 'body' ); return myElem ; }) var

Test Coverage React, Istanbul -_registerComponent(…): Target container is not a DOM element

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am writing an app with react / redux / webpack. I am building out my testing with karma, mocha and want to use istanbul for test coverage. In an attempt to get coverage to work with karma-coverage I have set up the following karma.config.js var argv = require ( 'yargs' ). argv ; var path = require ( 'path' ); var webpack = require ( 'webpack' ); const PATHS = { test : path . join ( __dirname , 'test' ), app : path . join ( __dirname , 'app' ), } module . exports = function ( config ) { config . set ({ // only use PhantomJS for

PhantomJS: “SyntaxError: Unexpected token =>”

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im currently having problems using phantomJS. Any suggestions? acanyon$ babel-node source_parser.js http://url /Users/.../node/node_modules/phantom/lib/index.js:23 return new Promise(resolve => resolve(new _phantom2.default(args, config))); ^^ SyntaxError: Unexpected token => at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Module._extensions..js (module.js:478:10) at Object.require.extensions.(anonymous function) [as .js] (/Users/acanyon/.nvm/versions/node/v0.12.4/lib/node_modules/babel-cli/node_modules

Using Multiple page.open in Single Script

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My goal is to execute PhantomJS by using: // adding $op and $er for debugging purposes exec ( 'phantomjs script.js' , $op , $er ); print_r ( $op ); echo $er ; And then inside script.js , I plan to use multiple page.open() to capture screenshots of different pages such as: var url = 'some dynamic url goes here' ; page = require ( 'webpage' ). create (); page . open ( url , function ( status ) { console . log ( 'opening page 1' ); page . render ( './slide1.png' ); }); page = require ( 'webpage' ). create (); page . open ( url ,

TeamCity: PhantomJS have not captured in 60000 ms, killing

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm encountering an issue when running tests in my CI environment. The configuration works fine on MacOS 10.11.6 (El Capitan), with Node v6.0.0 / npm 3.8.6, but on a TeamCity 9.1.6 agent running Windows with Node v4.2.2 / npm 2.14.7, it fails miserably with an error of PhantomJS have not captured in 60000 ms . Here's an example stacktrace on TeamCity: [08:58:40][exec] 02 11 2016 08:58:41.095:DEBUG [config]: autoWatch set to false, because of singleRun [08:58:40][exec] 02 11 2016 08:58:41.102:DEBUG [plugin]: Loading plugin karma-jasmine. [08

phantomjs Can not connect to the Service phantomjs错误

匿名 (未验证) 提交于 2019-12-03 00:30:01
打开hosts文件配置 cat /etc/hosts 添加 127.0.0.1 localhost 重新运行 由于我是从服务的日志中看到报错的,可能是因为phantomjs这个出错了,于是我就在88服务器上直接运行如个代码: [root(songxianfeng01 @58OS)@bjm6-193-88ershouservices]# python >>> from selenium import webdriver >>>dr=webdriver.PhantomJS( 'phantomjs' ) 结果报如下错误: Traceback (most recent call last ): File "/usr/local/python2.7/lib/python2.7/site-packages/selenium-3.6.0-py2.7.egg/selenium/webdriver/phantomjs/webdriver.py" , line 61 , in __init__self.service. start () File "/usr/local/python2.7/lib/python2.7/site-packages/selenium-3.6.0-py2.7.egg/selenium/webdriver/common/service.py" , line 88 , in

四、安装ElasticSearch Head插件

匿名 (未验证) 提交于 2019-12-03 00:26:01
一、简介: elasticsearch-head是一个用于浏览ElasticSearch集群并与其进行交互的Web项目 https://github.com/mobz/elasticsearch-head 二、安装 sudo elasticsearch/bin/plugin install mobz/elasticsearch-head sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/1.x sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/0.9 (Chrome扩展程序) https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/ 点击下载 [root@gameServer local]# su payment [payment@gameServer local]$ cd ~/elasticSearch/ [payment@gameServer elasticSearch]$ ll 总用量 28388 drwxr-xr-x. 9 payment payment 4096 6月 6 10:21

win10无法运行phantomjs

匿名 (未验证) 提交于 2019-12-03 00:17:01
echarts利用phantomjs将 图片保存到电脑,在win7下好好的,在win10下报错: 'phantomjs' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 在win7下没有配置环境变量,在win10下需要配置环境变量。虽然我win10账有管理员权限,配置系统环境变量仍不起作用。 最后在用户环境变量配置成功。配置到phantomjs的bin目录即可 来源:博客园 作者: 张亚南 链接:https://www.cnblogs.com/yanan7890/p/11790693.html