phantomjs

PhantomjsDriver not working on both Windows and Linux

对着背影说爱祢 提交于 2019-12-23 09:56:14
问题 I have an application that uses Selenium Webdriver to get some information from a site. It works fine with FirefoxDriver and ChromeDriver, but when I tried to switch to PhantomJSDriver, I encountered some difficulties. On a Windows machine , it starts normally, then immediately begins spitting out the following lines over and over again: Jan 05, 2014 7:28:43 PM org.apache.http.impl.client.DefaultRequestDirector tryEx ecute INFO: I/O exception (org.apache.http.NoHttpResponseException) caught

Capture video with Poltergeist, PhantomJS and Capybara

淺唱寂寞╮ 提交于 2019-12-23 09:52:50
问题 Is it possible to capture video with PhantomJS in combination with the gems Poltergeist, Capybara and Cucumber? I have used the Headless gem previously, which put a video in a specific folder in case a scenario failed. If all went well, no video was stored. Headless uses Xvfb and ffmpeg. Can ffmpeg also be used to provide the same functionality as shown here: https://github.com/leonid-shevtsov/headless/blob/master/lib/headless/video/video_recorder.rb I basically need the same functionality,

Phantomjs Function.prototype.bind

本小妞迷上赌 提交于 2019-12-23 09:05:02
问题 Yes, I know that. Function bind is not supported by Phantomjs. But maybe I can use something else, or say page.open not to use bind ? It seems to be OK, but some websites return error TypeError: 'undefined' is not a function (evaluating 'b.bind(a)') After that I wrote a simple script, which just opens a page: var address = phantom.args[0]; if(!address) phantom.exit(1); page = require("webpage").create(); page.open(address, function(status){ setInterval( function () { console.log( page

How to set the user agent string in the phantom module?

戏子无情 提交于 2019-12-23 09:01:43
问题 var phantom = require('phantom'); console.dir(phantom); phantom.create(function(browser){ browser.createPage(function(page){ page.customHeaders={ "HTTP_USER_AGENT": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36", }; console.dir(page.settings); //undefined page.settings={}; page.settings.userAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36'; page.settings.HTTP_USER_AGENT

PhantomJS script returning blank web page

人走茶凉 提交于 2019-12-23 08:35:59
问题 I'm using phantomJS to create PDFs in PHP via the shell ( shell_exec ). The script works fine on the production server, and also works fine if I plug the PhantomJS command directly into my terminal. But it does not work when I run the script in my local dev environment. I'm wondering if there's a permissions issue involved. I won't dive into the specifics of my local environment for now since I'm guessing this is a high-level issue... The command that is supposed to execute via shell_exec() :

PhantomJS, but not headless?

北慕城南 提交于 2019-12-23 07:39:04
问题 Is there a way to get a realtime view of what PhantomJS (or similar) is rendering? I would like to develop my automation script while interacting with (or at least seeing a screencap of) the page it's targeted to. 回答1: No, there is no such thing. SlimerJS has the same API as PhantomJS, but runs the Gecko engine. You can see directly what is going on and run it headlessly with xvfb-run. You will not be able to interact with it. You may want to use a screengrabber to record a video of the

phantomjs + web fonts + font loader

℡╲_俬逩灬. 提交于 2019-12-23 07:04:06
问题 I'm running phantomjs within a node.js environment, and it's going well. At the moment I'm just using local fonts, but want to get google web fonts working with phantomjs. There are various conflicting and confusing reports out there about whether and how web fonts can be made to work with phantomjs . There are articles like this that contain outdated information with dead links. And posts like this that suggest that phantomjs 2.0 will or can support web fonts, others saying that it doesn't

Running PhantomJS from PHP with exec()

我的梦境 提交于 2019-12-23 05:29:14
问题 I've got the following script: #!/bin/sh export DISPLAY=:0 phantomjs --version It try to run it from the following PHP script: <?php $result = shell_exec('sh test.sh'); echo $result; ?> This script return the following error: [Thu Jun 19 10:31:31 2014] [error] [client] test.sh: line 3: phantomjs: command not found I tried to run phantomjs -v by hand in a console, and it runs fine. I checked the PATH , and phantomjs is correctly defined and found. The execution environment is a virtual Server

dalek-browser-chrome fails installing everytime

两盒软妹~` 提交于 2019-12-23 05:17:45
问题 on my Ubuntu. I tried installing the browser plugin from chrome just as the website says to execute. npm install dalek-browser-chrome --save-dev problem is I get this error when running the command. > dalek-browser-chrome@0.0.9 install /home/monece/Desktop/dalekjs/node_modules/dalek-browser-chrome > node install.js Chromedriver installation failed Error: EACCES, permission denied '/home/monece/tmp/chromedriver' at Object.fs.mkdirSync (fs.js:642:18) at mkdir (/home/monece/Desktop/dalekjs/node

python phanthomjs is not working with nohup

我怕爱的太早我们不能终老 提交于 2019-12-23 04:47:06
问题 I'm running selenium using phanthomjs, the script is running perfectly if when I trigger it as: python my_script.py But when I try to using nohup: nohup python my_script.py & I got the following error: selenium.common.exceptions.WebDriverException: Message: Service phantomjs unexpectedly exited. Status code was: 8 回答1: It's probably too late but I just met similar error just with another code and I've found a solution. So, when you run nohup your program's output is redirected to nohup.out,