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

Feat: support for puppeteer-extra plugins #149

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

xtrime-ru
Copy link
Contributor

@xtrime-ru xtrime-ru commented Aug 11, 2021

Corresponding issue: #67

Added new option to allow override puppeteer instance.

This is example usage of puppeteer-extra-plugin-stealth:

<?php
require "vendor/autoload.php";

use Nesk\Puphpeteer\Puppeteer;

$puppeteer = new Puppeteer([
    'js_extra' => /** @lang JavaScript */ "
        const puppeteer = require('puppeteer-extra');
        const StealthPlugin = require('puppeteer-extra-plugin-stealth');
        puppeteer.use(StealthPlugin());
        instruction.setDefaultResource(puppeteer);
    ",
]);
$browser = $puppeteer->launch();

$page = $browser->newPage();

$page->goto('https://bot.sannysoft.com');
$page->waitForTimeout(5000);
$page->screenshot(['path' => 'example2.png', 'fullPage'=> true]);

$browser->close();

Without plugin:
example2

With plugin (code above):
example

@Dr10s
Copy link

Dr10s commented Aug 19, 2021

I'm waiting for this feature <3

@btidude
Copy link

btidude commented Aug 20, 2021

I'm also waiting for this feature

@overgapo
Copy link

👍

1 similar comment
@jsandeo
Copy link

jsandeo commented Oct 7, 2021

👍

@jfrancuz
Copy link

@xtrime-ru - thanks a lot!
@nesk, this feature is very much needed - please review the PR. Hopefully, it can be accepted!

@xtrime-ru
Copy link
Contributor Author

xtrime-ru commented May 25, 2022

@xtrime-ru - thanks a lot!

You welcome! While waiting nesk to aprove my PR you can use our fork with all new features:

  • Updated and fixed PHPDOC (PhpStorm compatible)
  • Puppeteer ^13 support ( its little outdated now, but better than nothing )
  • puppeteer-extra-plugin-stealth support

@TheWildHorse
Copy link

Wow! Nice job dude! Would love for this to get this merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants