phantomjs

Installing casperJS and phantomJS in WIndows Apache 2.4 to pass data to PHP

馋奶兔 提交于 2019-12-08 03:06:35
问题 I am attempting to run my casperjs script by clicking a Run button in a website. My local set up is PHP 5.5.14 with Apache 2.4 on Windows7 [properly running; tested with php page]; and my question is: how do I properly install casperJS and phantomJS so that its PATH is recognized when I execute the script. I need to know what the path is in Windows to be able to use this: putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs"); . I have gone over the following possible solutions but none of

Page-break-inside support in phantomjs on heroku

自作多情 提交于 2019-12-08 02:21:42
问题 I have a NodeJS app using PhantomJS to generate PDF files. My app is deployed to Heroku and I'm using this phantom build pack. Unfortunately this build pack does not support the page-break-inside: avoid CSS property. I did a research and found 2 hacks on this GitHub issue page. I've tried both of them, but unfortunately I can't use the CSS one, due to my page structure and the JavaScript one isn't page-breaking properly. One of the guys in the GitHub link above mentioned that this problem is

Ways to reduce CPU usage while using PhantomJS/CasperJS

蓝咒 提交于 2019-12-08 02:14:54
问题 Am using PhantomJS and CasperJS for screenscraping and stuff. The issue which I am facing is that its taking too much CPU usage which makes me feel it might not be that scalable. Are there any ways to reduce CPU usage for the same. Some of which I can think of are: 1) Disable image loading 2) Disable js loading Also I want to know if python is more light(in terms of CPU usage) than phantom for the scraping purpose. 回答1: After 5 and a half years I don't think you are having this issue anymore,

Selenium, Selecting an element inside of a <span>

半腔热情 提交于 2019-12-08 02:10:24
问题 The error is: Select only works on <select> elements, not on <span>. Trying to accomplish this using PhantomJS & Selenium in Python. Closest I've come to maybe finding an answer is this: How can i select this span element? Trying to learn Selenium automation, and figured working w/Gmail would be a challenege. Right now trying to select 'Birth Month' at the account creation stage. https://accounts.google.com/SignUp?service=mail&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ltmpl=default&hl

Remote PhantomJS driver in Junit

白昼怎懂夜的黑 提交于 2019-12-08 01:54:52
问题 How do i configure selenium with a remote phantomjs drive in junit? I have been trying to find a tutorial for this but had no luck. My goal is to use this for testing in spring mvc for my single page application. 回答1: After some trial and error I have reached the following solution. This configuration is used in the Junit test class private URI siteBase; private static PhantomJSDriverService service; private WebDriver driver; protected static DesiredCapabilities dCaps; @BeforeClass public

RSelenium Error: Can't Connect to Host; Selenium Server is not running

旧巷老猫 提交于 2019-12-08 00:10:21
问题 I am getting the following error: "Error in checkError(res) : Couldnt connect to host on http://localhost:4444/wd/hub. Please ensure a Selenium server is running." I'm using a mac version 10.9.5, and downloaded all of the latest versions of packages and java. My code is: library(rvest) library(RSelenium) library(wdman) setwd(Path to selenium standalone file) pJS <- phantomjs(pjs_cmd = "/phantomjs-2.1.1-macosx/bin/phantomjs") remDr <- remoteDriver(browserName = "phantomjs") Sys.sleep(5) remDr

'Can't find module fs' when running casperjs on js file

柔情痞子 提交于 2019-12-07 23:19:04
问题 I am trying to run CasperJS on a javascript file that I have, and when I run > casperjs index.js it says 'CasperError: Cant find module fs'. The first line of index.js is var fs = require('fs'); I have node, casperjs, and phantomjs installed, why can't it find fs? If I am correct, fs is Node's file system? UPDATE: I added nodejs to my $PATH, but still no luck. 回答1: Did you install the PhantomJS/CasperJS modules as well as the node fs module in your project? They don't seem to mix very well. I

Karma + PhantomJS + no internet access

穿精又带淫゛_ 提交于 2019-12-07 22:32:46
问题 I need to run Karma tests using PhantomJS on a continuous integration server with no internet access. Every build starts from running npm install --no-registry and then grunt Grunt Karma is configured for single run ( singleRun: true ) Everything works well except PhantomJS. Even though phantomjs package is in npm-cache it tries to download actual binary (.exe in my case) directly from bitbucket.org and obviously fails due to no inet access. I tried to pre-install PhantomJS package globally (

PhantomJS WebPage memory consumption?

百般思念 提交于 2019-12-07 21:45:13
问题 Is there a programmatic (since i want to do it automatically at runtime) way to see how much memory a webpage uses when running it through PhantomJs? I am also using casperjs if that could be helpful. I have searched a lot but haven't found any way. PhantomJs uses QtWebKit so I don't have access to window.performance.memory. I want to have this information since I am setting up automated performance tests for a web application. Thanks in advance 回答1: No, at this time this feature is not

uncss Error: C.UTF-8: not a valid language tag

故事扮演 提交于 2019-12-07 20:48:42
问题 Hi I am trying to use UNCSS to remove unused styles from CSS for the first time and I am getting the following error: Fontconfig warning: ignoring C.UTF-8: not a valid language tag /home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/bluebird/js/main/async.js:43 fn = function () { throw arg; }; ^ Error: Fontconfig warning: ignoring C.UTF-8: not a valid language tag at Socket.onStderr (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/phridge/lib/spawn.js:79:28) at