puphpeteer
puphpeteer copied to clipboard
Support for Laravel 9
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]
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!
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 Yes.Screenshot can use Browsershot. But crawl use puphpeteer best.
@likunyan This can be the alternative for crawling: https://github.com/spatie/crawler
@janihq Thanks, I'll try it out.
not as usefull as puphpeteer but ok
I just cant figure out how to click around properly if he makes that simpler this will be the best php bot framework
Temporary :
composer require likunyan/puphpeteer@dev-dev
Getting a 404 :(
@seifti Sorry, i clear other reop in my reops, but i accidentally deleted this repository.
+1
+1
+1