Giter Club home page Giter Club logo

casperjs-php's People

Contributors

synacksa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

casperjs-php's Issues

please help,i cant get any page with https

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();

Having trouble setting it up

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?

option setup error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.