Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Size limitations in JsFunction? #16

Closed
systemaddict opened this issue Jul 24, 2018 · 6 comments
Closed

Size limitations in JsFunction? #16

systemaddict opened this issue Jul 24, 2018 · 6 comments

Comments

@systemaddict
Copy link

systemaddict commented Jul 24, 2018

Hi

I'm trying to get the complete HTML but it's returning null.

$puppeteer = new Puppeteer;
$browser = $puppeteer->launch();

$page = $browser->newPage();

$page->goto( 'https://google.com' );

$page->waitFor(5000);

$page_meta = $page->evaluate(JsFunction::create("   
    return {
        body: document.body.innerHTML
    };
"));

var_dump( $page_meta );

It will work with this:

$page_meta = $page->evaluate(JsFunction::create("   
    return {
        body: document.querySelector('#main').innerHTML
    };
"));
@nesk
Copy link
Member

nesk commented Jul 24, 2018

Just tried the two versions of your code and everything is running fine with the latest version of PuPHPeteer.

What version of PuPHPeteer are you using? What are the versions of PHP/Node?

And provide some logs please.

@nesk
Copy link
Member

nesk commented Jul 24, 2018

Actually, now I remember, PuPHPeteer had a size limitation. This was a bug and was fixed since v0.2.1, please upgrade to the latest version (currently, v1.1.0).

@nesk nesk closed this as completed Jul 24, 2018
@systemaddict
Copy link
Author

Hi

Thanks for looking into this. I'm already running 1.1.0 (puppeteer 1.6.0) and Node 8.11.3. There's a warning about puppeteer 1.6.0.

pupp.log

@nesk
Copy link
Member

nesk commented Jul 25, 2018

First, I have two things to say:

However, these two points doesn't seem to be related to the issue here.

I've created a bare repository to test your code and it still works, I've even installed Puppeteer v1.6 instead of the recommended v1.5.

What I want you to try is to run the following commands:

git clone https://gist.github.com/d53a896334a650cb8170f8dd3293af5c.git puphpeteer-test
cd puphpeteer-test
composer install && npm install && php puphpeteer.php

And send me the logs. The logs you sent before are, curiously, broken (there are some encoding issues), I wonder if this is a consequence of your issues (it's possible).

Also, if the issue persists with this simple repository, I would like you to edit your first message and use this template to provide me more relevant informations.

@nesk nesk reopened this Jul 25, 2018
@systemaddict
Copy link
Author

Hi Nesk. The result is the same. Please close this issue. I will try on another server and reopen with better info if it persists.

@nesk
Copy link
Member

nesk commented Jul 26, 2018

What I can also suggest you is to try in a VM, and if the bug persists you only have to send me the VM so I can try myself. 😉

@nesk nesk closed this as completed Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants