synacksa / casperjs-php Goto Github PK
View Code? Open in Web Editor NEWExtension of alwex/php-casperjs including extra functions
License: MIT License
Extension of alwex/php-casperjs including extra functions
License: MIT License
Hi guys,im using phantomsjs 2.1.1, php 5.6, casperjs 1.1.0, and im running localhost. im ok getting pages with http,but i cant get anything with https, i have read about this everywhere,i have tried another versions of casperjs and phantomjs ,and everything ive seen,but anything is working for me . Oh,also im usign the jonnnnyw.github.io/php-phantomjs/ version. So Im leaving you here the debug code and my script code,because thats better than 1000 words,lmao. Thank u very much guys!
/*********** Debug Code im getting ************/
array (size=22)
0 => string '[info] [phantom] Starting...' (length=28)
1 => string '[info] [phantom] Running suite: 3 steps' (length=39)
2 => string '[debug] [phantom] Successfully injected Casper client-side utilities' (length=68)
3 => string '[debug] [phantom] opening url: https://www.cubamaltrato.com/, HTTP GET' (length=70)
4 => string '[debug] [phantom] Navigation requested: url=https://www.cubamaltrato.com/, type=Other, willNavigate=true, isMainFrame=true' (length=122)
5 => string '[info] [phantom] Step anonymous 1/3: done in 73ms.' (length=50)
6 => string '[warning] [phantom] Loading resource failed with status=fail: https://www.cubamaltrato.com/' (length=91)
7 => string '[info] [phantom] Step _step 2/3: done in 1295ms.' (length=48)
8 => string '[info] [phantom] wait() finished waiting for 10000ms.' (length=53)
9 => string 'timeout occured' (length=15)
10 => string '[CURRENT_URL]about:blank' (length=24)
11 => string '[CURRENT_TITLE]' (length=15)
12 => string '[CURRENT_PAGE_CONTENT]' (length=61)
13 => string '[CURRENT_HTML]' (length=53)
14 => string '[CURRENT_HEADERS][]' (length=19)
15 => string '[CURRENT_STATUS]null' (length=20)
16 => string '[CURRENT_STATUS_TEXT]null' (length=25)
17 => string '[CURRENT_COOKIES][]' (length=19)
18 => string '[info] [phantom] Step anonymous 3/3: done in 11301ms.' (length=53)
19 => string '[info] [phantom] Done 3 steps in 11317ms' (length=40)
20 => string '[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=true' (length=104)
21 => string '[debug] [phantom] url changed to "about:blank"' (length=46)
/***** my script code ***/
use Browser\Casper;
$casper = new Casper();
$casper->setPath2Casper('my path to casperjs/bin/');
//some people said this is the answer but it wasnt for me :(
$casper->setOptions(array('ignore-ssl-errors' => 'yes','ssl-protocol' => 'any','debug' => 'true'));
$casper->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36');
//some page with https
$casper->start('https://www.cubamaltrato.com');
$casper->wait(10000);
$output = $casper->getOutput();
$start = $casper->run();
//this one returns the debug code from above
var_dump($start);
//and this one just an empty array
var_dump($output);
//this one returns the html only when the page is using http
$html = $casper->getHtml();
I'm new to this whole composer thing and I'm having trouble setting this dependency. I downloaded composer.json and placed it in my project folder. In the command prompt I ran
composer require synacksa/casperjs-php
I got the following error message
[InvalidArgumentException]
Could not find package synacksa/casperjs-php at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
I tried running the following command
composer require "synacksa/casperjs-php:*"
and I got this error
./composer.json has been updated
Root package 'synacksa/casperjs-php' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?
What am I doing wrong?
Hello, I found out that you've missed one space for adding the options and I got following error :
Unable to open file: /tmp/php-casperjs-IGvucs--ignore-ssl-errors=yes
In the file Casper.php line 604 :
$options[] = "--{$option}={$value}";
One space before -- is needed :
$options[] = " --{$option}={$value}";
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.