puphpeteer icon indicating copy to clipboard operation
puphpeteer copied to clipboard

Support for Laravel 9

Open parthjani7 opened this issue 2 years ago • 12 comments

Describe the bug Laravel 9 throws following error:

Reproducible example

Problem 1
    - symfony/process[v4.0.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (8.1.5) does not satisfy that requirement.
    - symfony/process[v5.0.0-BETA1, ..., v5.0.0-RC1] require php ^7.2.9 -> your php version (8.1.5) does not satisfy that requirement.
    - symfony/process[v5.0.0, ..., v5.1.0-RC1] require php ^7.2.5 -> your php version (8.1.5) does not satisfy that requirement.
    - Root composer.json requires nesk/puphpeteer ^2.0 -> satisfiable by nesk/puphpeteer[2.0.0].
    - Conclusion: don't install symfony/process v5.4.8 (conflict analysis result)
    - Root composer.json requires laravel/framework 9.0 -> satisfiable by laravel/framework[v9.0.0].
    - nesk/puphpeteer 2.0.0 requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
    - nesk/rialto 1.4.0 requires symfony/process ^3.3|^4.0|^5.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
    - nesk/rialto[1.2.0, ..., 1.3.0] require symfony/process ^3.3|^4.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev].
    - You can only install one version of a package, so only one of these can be installed: symfony/process[v3.2.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.1.x-dev].
    - laravel/framework v9.0.0 requires symfony/process ^6.0 -> satisfiable by symfony/process[v6.0.0-BETA1, ..., 6.1.x-dev].
    - Conclusion: don't install symfony/process v6.0.8 (conflict analysis result)

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 20.04]
  • Node version: [e.g. 16.13.2]
  • PHP version [e.g. 8.1.5]

parthjani7 avatar Apr 28 '22 14:04 parthjani7

Hey Team, I am seeing the same as @parthjani7.

PHP version: 8.0.8 Laravel version: 9.2

composer require nesk/puphpeteer

Your requirements could not be resolved to an installable set of packages.

Problem 1 - Root composer.json requires nesk/puphpeteer ^2.0 -> satisfiable by nesk/puphpeteer[2.0.0]. - nesk/puphpeteer 2.0.0 requires psr/log ^1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Excited to try it out once we can get it to play nice with Laravel 9.2

Thanks!

CodeSuite avatar Apr 28 '22 16:04 CodeSuite

Those who are looking for a better alternative, much stable and widely used : https://github.com/spatie/browsershot

$puppeteer = new Puppeteer;
$browser = $puppeteer->launch(['args' => ['--no-sandbox', '--disable-setuid-sandbox']]);

$page = $browser->newPage();
$page->goto($url, ["waitUntil" => "networkidle2"]);
$page->emulateMediaType('screen');
$page->pdf(['path' => $path, 'printBackground' => true]);
$browser->close();

Becomes

Browsershot::url($url)
                    ->setOption('args', ['--no-sandbox', '--disable-setuid-sandbox'])
                    ->waitUntilNetworkIdle(false)
                    ->emulateMedia('screen')
                    ->savePdf($pathToSave);

janihq avatar May 11 '22 14:05 janihq

@janihq Yes.Screenshot can use Browsershot. But crawl use puphpeteer best.

dogeow avatar May 12 '22 01:05 dogeow

@likunyan This can be the alternative for crawling: https://github.com/spatie/crawler

janihq avatar May 12 '22 01:05 janihq

@janihq Thanks, I'll try it out.

dogeow avatar May 12 '22 03:05 dogeow

not as usefull as puphpeteer but ok

PJTH3G0D avatar May 13 '22 23:05 PJTH3G0D

I just cant figure out how to click around properly if he makes that simpler this will be the best php bot framework

PJTH3G0D avatar May 13 '22 23:05 PJTH3G0D

Temporary : composer require likunyan/puphpeteer@dev-dev

Getting a 404 :(

seifti avatar Jul 07 '22 14:07 seifti

@seifti Sorry, i clear other reop in my reops, but i accidentally deleted this repository.

dogeow avatar Jul 07 '22 16:07 dogeow

+1

SpurIT avatar Aug 26 '22 13:08 SpurIT

+1

iammayron avatar Oct 11 '22 16:10 iammayron

+1

iammayron avatar Oct 11 '22 17:10 iammayron