Questions tagged [php-phantomjs]

PHP Library to load pages through PhantomJS

PHP PhantomJS is a flexible PHP library to load pages through the PhantomJS headless browser and return the page response. It is handy for testing websites that demand javascript support and also supports screen captures.

https://github.com/jonnnnyw/php-phantomjs

43 questions
1
vote
1 answer

Trying to execute phantomjs from php

Hello i'm having some troubles with phantomjs. Im trying execute a simple statement but im getting the same error over and over. exec('../bin/phantomjs --version', $o, $r); var_dump($r); print_r($o); im getting this: int(2) Array ( [0] =>…
J.Wennergren
  • 145
  • 14
1
vote
1 answer

PHP PhantomJS causing 408 Timeout response if page is re-executed after previously already run

I am working on a project which uses PHP Phantom JS. It seems to work once, but they if I try and re-run the script again to regenerate the PDF I then get a 408 HTTP status saying it timed out (it didn't actually timeout its my local PC). If I…
Boardy
  • 35,417
  • 104
  • 256
  • 447
1
vote
1 answer

PHP PhantomJS - "use JonnyW\PhantomJs\Client;" Error?

I've installed PhantomJS and PHP-PhantomJS per the PHP-PhantomJS docs. Per the PHP-PhantomJS docs, I have the following lines at the top of a php file: use JonnyW\PhantomJs\Client; $client = Client::getInstance(); When executing $client =…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
0 answers

408 response when looping page requests with php-PhantomJS

I am trying to test average pageLoad time, sending requests with PhantomJS php engine, using Symfony. Why for some pages half of the time I recieve 408 response, and only half - 200? Is there some delay or option additionaly needed? public function…
1
vote
1 answer

Using proxies in PhantomJS with PHP PhantomJS library

The documentation for PhantomJS does show how to use proxies. However, how is is used in PHP when using the library from PHP PhantomJS? For that matter, how are any of the PhantomJS addons used? I'm currently doing this with CURL to use…
user2029890
  • 2,493
  • 6
  • 34
  • 65
0
votes
0 answers

How to solve object object problem in Phantomjs?

I tried all the Id and class options. I tried to pull the element using the last tag. But it writes [object Object] expression to the console. This object cannot be fragmented in any way. var webpage = require('webpage'); var page =…
0
votes
0 answers

PhantomJSCloud How to use mouse click options

I would like to know and understand how I can add javascript code to my current code in order to perform actions such as a click on a page that I loaded using phantomjscloud using their api. Here is my current code, it works and returns the HTML…
0
votes
1 answer

Why php phantomjs not executd js code in response content

I need get html with executed js for this I install phantomjs but in get content I had still old html, with old data, data should was handling by js script and should changed to span tag with some class, which script should execute. I correct…
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
0
votes
1 answer

PHP PhantomJS get page contents after JavaScript reload

I am trying to get the contents of this page with php-phantomjs. After some digging, I noticed that this page first loads this JavaScript code: function setCookie(c_name, value, expiredays) { // Local function for setting a value of a cookie var…
hiddeneyes02
  • 2,562
  • 1
  • 31
  • 58
0
votes
1 answer

Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in php-phantomjs

i can't get any data from php-phantom it's not working with me i found this error in php_log file when i tried get source page using php-phantom and this is the Full code require 'vendor/autoload.php'; use JonnyW\PhantomJs\Client; $client…
0
votes
1 answer

How to display response from custom phantomjs scripts

I can't seem to be able to display a response from my custom .proc file. I'm running php-phantomjs on laravel 5.6 on ubuntu. I've got a URL endpoint I'm using to invoke the custom file as follows: public function getLinks() { $location =…
andromeda
  • 4,433
  • 5
  • 32
  • 42
0
votes
2 answers

how do I use simple_html_dom with phantomjs

I am trying to get those two libraries to work with each other my current code looks like this: phantomjs.js var page = require('webpage').create(); var system = require('system'); var address = system.args[1]; page.open(address, function () { …
syrkull
  • 2,295
  • 4
  • 35
  • 68
0
votes
1 answer

PhantomJs screenshot is not rendering correctly

We are developing a web scraper type thing, where the user enters a website's url and our web application generates a screenshot of the website. We use phantomjs's rendering for generating the screenshot in PNG format. Although it works like a charm…
Mustafa sabir
  • 4,130
  • 1
  • 19
  • 28
0
votes
1 answer

How to solve permission denied error for phantom js in ubuntu?

I am working on a laravel project where I am trying to use php wrapper of phantom js made by jonnyw. I have done everything written in the docs. I have downloaded the 32 bit executable file and set the path in my code, but it still gives me the…
Tahir Raza
  • 726
  • 1
  • 7
  • 20
0
votes
1 answer

phantomjs API error

I'm using https://phantomjscloud.com to generate pdf snapshots of a website. I'm using a really basic example as follows: $Foptions = new stdClass(); $Foptions->url = 'http://lr.boatsetter.com/boat/?id=1'; $Foptions->renderType =…
Aschab
  • 1,378
  • 2
  • 14
  • 31